jabber-disconnect: Display "Already disconnected" if that is the case

This commit is contained in:
Magnus Henoch 2012-09-16 19:28:03 +01:00
parent 2810cac378
commit 58cc4ecc28
1 changed files with 9 additions and 7 deletions

View File

@ -788,14 +788,16 @@ With double prefix argument, specify more connection details."
(jabber-disconnect-one (jabber-read-account))
(unless *jabber-disconnecting* ; avoid reentry
(let ((*jabber-disconnecting* t))
(run-hooks 'jabber-pre-disconnect-hook)
(dolist (c jabber-connections)
(jabber-disconnect-one c t))
(setq jabber-connections nil)
(if (null jabber-connections)
(message "Already disconnected")
(run-hooks 'jabber-pre-disconnect-hook)
(dolist (c jabber-connections)
(jabber-disconnect-one c t))
(setq jabber-connections nil)
(jabber-disconnected)
(when (interactive-p)
(message "Disconnected from Jabber server(s)"))))))
(jabber-disconnected)
(when (interactive-p)
(message "Disconnected from Jabber server(s)")))))))
(defun jabber-disconnect-one (jc &optional dont-redisplay)
"Disconnect from one Jabber server.