summaryrefslogtreecommitdiff
path: root/jabber-muc.el
diff options
context:
space:
mode:
authorMagnus Henoch <mange@freemail.hu>2006-05-18 14:20:31 +0000
committerKirill A. Korinskiy <catap@catap.ru>2006-05-18 14:20:31 +0000
commit6cc9765f4605cf971c6dc6276aa3e88c78a859b3 (patch)
tree76470b2b1018e244501ed2943d7ac08e681ff31e /jabber-muc.el
parent1bc35563c752ecd25a4983e05485f6cc6c1396c2 (diff)
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-231
Creator: Magnus Henoch <mange@freemail.hu> Identify different errors in MUC joining
Diffstat (limited to 'jabber-muc.el')
-rw-r--r--jabber-muc.el19
1 files changed, 12 insertions, 7 deletions
diff --git a/jabber-muc.el b/jabber-muc.el
index 31da136..c946826 100644
--- a/jabber-muc.el
+++ b/jabber-muc.el
@@ -384,21 +384,26 @@ JID; only provide completion as a guide."
(defun jabber-groupchat-join-2 (closure result)
(destructuring-bind (group nickname interactive) closure
- ;; result might be nil, in which case destructuring-bind would fail.
- (let ((identities (car result))
- (features (cadr result)))
+ (let (;; Either success...
+ (identities (car result))
+ (features (cadr result))
+ ;; ...or error
+ (condition (when (eq (car result) 'error) (jabber-error-condition result))))
(cond
;; Maybe the room doesn't exist yet.
- ;; XXX: that's not the only possible error.
- ((null result)
+ ((eq condition 'item-not-found)
(unless (y-or-n-p (format "%s doesn't exist. Create it? " (jabber-jid-displayname group)))
- (error "Non-existent groupchat.")))
+ (error "Non-existent groupchat")))
+
+ ;; Maybe another error occurred.
+ (condition
+ (error "Couldn't query groupchat: %s" (jabber-parse-error result)))
;; Maybe it isn't a chat room.
((not (find "conference" identities
:key (lambda (i) (aref i 1))
:test #'string=))
- (error "%s is not a groupchat." (jabber-jid-displayname group))))
+ (error "%s is not a groupchat" (jabber-jid-displayname group))))
(let ((password
;; Is the room password-protected?