summaryrefslogtreecommitdiff
path: root/jabber-muc.el
diff options
context:
space:
mode:
authorMagnus Henoch <mange@freemail.hu>2008-06-09 22:47:48 +0000
committerKirill A. Korinskiy <catap@catap.ru>2008-06-09 22:47:48 +0000
commita47ec38e8ff3c04fa3e6c2adaf3faac760b9de48 (patch)
tree2dc4c0c90cf9299e8f1e8aef0d2b024dbb35f184 /jabber-muc.el
parent34d8be71d693cd83fe89b626126e7eeaaa926e56 (diff)
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-523
Creator: Magnus Henoch <mange@freemail.hu> "Services" chapter rewritten
Diffstat (limited to 'jabber-muc.el')
-rw-r--r--jabber-muc.el37
1 files changed, 22 insertions, 15 deletions
diff --git a/jabber-muc.el b/jabber-muc.el
index 64de966..17a6379 100644
--- a/jabber-muc.el
+++ b/jabber-muc.el
@@ -884,21 +884,28 @@ Return nil if X-MUC is nil."
;; error from room itself? or are we leaving?
(if (or (null nickname)
(string= nickname (gethash (jabber-jid-symbol group) jabber-pending-groupchats)))
- (let ((message (cond
- ((string= type "error")
- (concat "Error entering room"
- (when error-node
- (concat ": " (jabber-parse-error error-node)))))
- ((equal status-code "301")
- (concat "You have been banned"
- (when actor (concat " by " actor))
- (when reason (concat " - '" reason "'"))))
- ((equal status-code "307")
- (concat "You have been kicked"
- (when actor (concat " by " actor))
- (when reason (concat " - '" reason "'"))))
- (t
- "You have left the chatroom"))))
+ ;; Assume that an error means that we were thrown out of the
+ ;; room...
+ (let* ((leavingp t)
+ (message (cond
+ ((string= type "error")
+ (cond
+ ;; ...except for certain cases.
+ ((equal status-code "406")
+ ;; XXX: were we already in the room?
+ (concat "Error entering room"
+ (when error-node
+ (concat ": " (jabber-parse-error error-node)))))
+ ((equal status-code "301")
+ (concat "You have been banned"
+ (when actor (concat " by " actor))
+ (when reason (concat " - '" reason "'"))))
+ ((equal status-code "307")
+ (concat "You have been kicked"
+ (when actor (concat " by " actor))
+ (when reason (concat " - '" reason "'"))))
+ (t
+ "You have left the chatroom"))))
(jabber-muc-remove-groupchat group)
;; If there is no buffer for this groupchat, don't bother
;; creating one just to tell that user left the room.