From: Magnus H. <leg...@us...> - 2008-12-07 22:11:03
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27735 Modified Files: jabber-disco.el jabber-util.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-617 Creator: Magnus Henoch <ma...@fr...> Fix jabber-my-jid-p to work with disco, as advertised Make jabber-my-jid-p check against the provided connection object, too. Make jabber-return-disco-info pass the connection object to the access control function. Index: jabber-util.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-util.el,v retrieving revision 2.59 retrieving revision 2.60 diff -u -d -r2.59 -r2.60 --- jabber-util.el 19 Sep 2008 21:07:19 -0000 2.59 +++ jabber-util.el 7 Dec 2008 22:10:52 -0000 2.60 @@ -180,8 +180,12 @@ (intern (downcase (jabber-jid-user string)) jabber-jid-obarray))) (defun jabber-my-jid-p (jc jid) - "Return non-nil if the specified JID is in jabber-account-list (modulo resource). JC arg placed for compatibility and may be removed in future." - (member (jabber-jid-user jid) (mapcar (lambda (x) (jabber-jid-user (car x))) jabber-account-list))) + "Return non-nil if the specified JID is in jabber-account-list (modulo resource). +Also return non-nil if JID matches JC, modulo resource." + (or + (equal (jabber-jid-user jid) + (jabber-connection-bare-jid jc)) + (member (jabber-jid-user jid) (mapcar (lambda (x) (jabber-jid-user (car x))) jabber-account-list)))) (defun jabber-read-jid-completing (prompt &optional subset require-match default resource) "read a jid out of the current roster from the minibuffer. Index: jabber-disco.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-disco.el,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- jabber-disco.el 15 Apr 2007 23:53:00 -0000 1.14 +++ jabber-disco.el 7 Dec 2008 22:10:52 -0000 1.15 @@ -1,6 +1,6 @@ ;; jabber-disco.el - service discovery functions -;; Copyright (C) 2003, 2004, 2007 - Magnus Henoch - ma...@fr... +;; Copyright (C) 2003, 2004, 2007, 2008 - Magnus Henoch - ma...@fr... ;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in... ;; This file is a part of jabber.el. @@ -144,7 +144,7 @@ (access-control (nth 1 return-list))) (if return-list (if (and (functionp access-control) - (not (funcall access-control to))) + (not (funcall access-control jc to))) (jabber-signal-error "cancel" 'not-allowed) ;; Access control passed (let ((result (if (functionp func) |