You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(13) |
Jun
(3) |
Jul
(4) |
Aug
(30) |
Sep
(17) |
Oct
(2) |
Nov
(6) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(9) |
Feb
(30) |
Mar
(22) |
Apr
(23) |
May
(25) |
Jun
(25) |
Jul
(4) |
Aug
(21) |
Sep
(16) |
Oct
(44) |
Nov
(15) |
Dec
(3) |
2009 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(3) |
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(4) |
May
(2) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(10) |
Dec
|
2014 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(8) |
Jun
(5) |
Jul
(2) |
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(2) |
2015 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(6) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Magnus H. <leg...@us...> - 2007-09-19 06:59:32
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv25292 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-416 Creator: Magnus Henoch <ma...@fr...> Don't use jabber-resource in resource binding Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- jabber-core.el 14 Sep 2007 22:08:28 -0000 1.70 +++ jabber-core.el 19 Sep 2007 06:59:23 -0000 1.71 @@ -566,11 +566,13 @@ xml-data)))) ;; So let's bind a resource. We can either pick a resource ourselves, ;; or have the server pick one for us. - (jabber-send-iq fsm nil "set" - `(bind ((xmlns . "urn:ietf:params:xml:ns:xmpp-bind")) - (resource () ,jabber-resource)) - #'handle-bind t - #'handle-bind nil) + (let ((resource (plist-get state-data :resource))) + (jabber-send-iq fsm nil "set" + `(bind ((xmlns . "urn:ietf:params:xml:ns:xmpp-bind")) + ,@(when resource + `((resource () ,resource)))) + #'handle-bind t + #'handle-bind nil)) (list :bind state-data)) (message "Server doesn't permit resource binding and session establishing") (list nil state-data))) |
From: Magnus H. <leg...@us...> - 2007-09-17 20:25:57
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv2434 Modified Files: jabber-util.el jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-415 Creator: Magnus Henoch <ma...@fr...> Don't use jabber-password Index: jabber-util.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-util.el,v retrieving revision 2.51 retrieving revision 2.52 diff -u -d -r2.51 -r2.52 --- jabber-util.el 31 Aug 2007 21:45:12 -0000 2.51 +++ jabber-util.el 17 Sep 2007 20:25:44 -0000 2.52 @@ -261,18 +261,13 @@ (concat "xmpp:" bare-jid)) (defun jabber-read-password (bare-jid) - "Read Jabber password, either from customized variable or from minibuffer. -See `jabber-password'." - (if jabber-password - ;; Need to copy the password, as sasl.el wants to erase it. The - ;; variable jabber-password is a high-convenience low-security - ;; alternative anyway. - (copy-sequence jabber-password) - (let ((prompt (format "Jabber password for %s: " bare-jid))) - (if (fboundp 'password-read-and-add) - (copy-sequence - (password-read-and-add prompt (jabber-password-key bare-jid))) - (read-passwd prompt))))) + "Read Jabber password from minibuffer." + (let ((prompt (format "Jabber password for %s: " bare-jid))) + (if (fboundp 'password-read-and-add) + ;; Need to copy the password, as sasl.el wants to erase it. + (copy-sequence + (password-read-and-add prompt (jabber-password-key bare-jid))) + (read-passwd prompt)))) (defun jabber-uncache-password (bare-jid) "Uncache cached password for BARE-JID. Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- jabber-logon.el 17 Sep 2007 12:16:35 -0000 1.17 +++ jabber-logon.el 17 Sep 2007 20:25:44 -0000 1.18 @@ -47,7 +47,8 @@ ;; Plaintext passwords - allow on encrypted connections (if (or (plist-get (fsm-get-state-data jc) :encrypted) (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? ")) - (let ((passwd (jabber-read-password (jabber-connection-bare-jid jc)))) + (let ((passwd (or (plist-get (fsm-get-state-data jc) :password) + (jabber-read-password (jabber-connection-bare-jid jc))))) (when passwd (setq auth `(password () ,passwd)))))) |
From: Magnus H. <leg...@us...> - 2007-09-17 12:26:24
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv24028 Modified Files: jabber-conn.el jabber.el jabber-keepalive.el jabber-presence.el jabber-socks5.el jabber-iq.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-414 Creator: Magnus Henoch <ma...@fr...> Remove global variables Remove jabber-username, jabber-server, jabber-resource, jabber-nickname, jabber-network-server and jabber-port, and all remaining references to them. Index: jabber-presence.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-presence.el,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- jabber-presence.el 14 Sep 2007 23:14:03 -0000 1.34 +++ jabber-presence.el 17 Sep 2007 12:26:16 -0000 1.35 @@ -91,7 +91,7 @@ (jabber-roster-update jc new-items changed-items deleted-items) (if (and id (string= type "set")) - (jabber-send-iq jc jabber-server "result" nil + (jabber-send-iq jc nil "result" nil nil nil nil nil id))) ;; After initial roster push, run jabber-post-connect-hooks. We do Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- jabber.el 1 Sep 2007 15:58:16 -0000 1.79 +++ jabber.el 17 Sep 2007 12:26:16 -0000 1.80 @@ -87,28 +87,6 @@ (const :tag "Legacy SSL/TLS" ssl)))))) :group 'jabber-core) -;; XXX: kill these four variables -(defcustom jabber-username "emacs" - "jabber username (user part of JID)" - :type 'string - :group 'jabber) - -(defcustom jabber-server "magaf.org" - "jabber server (domain part of JID)" - :type 'string - :group 'jabber) - -(defcustom jabber-password nil - "jabber password" - :type '(radio (const :tag "Prompt for password" nil) - (string :tag "Save password in .emacs")) - :group 'jabber) - -(defcustom jabber-resource "emacs" - "jabber resource" - :type 'string - :group 'jabber) - (defcustom jabber-default-show "" "default show state" :type '(choice (const :tag "Online" "") @@ -128,12 +106,6 @@ :type 'integer :group 'jabber) -;; XXX: kill this one too -(defcustom jabber-nickname jabber-username - "jabber nickname, used in chat buffer prompts and as default groupchat nickname." - :type 'string - :group 'jabber) - ;;; guess internal dependencies! (require 'jabber-util) (require 'jabber-menu) Index: jabber-keepalive.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-keepalive.el,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- jabber-keepalive.el 31 Jul 2007 07:05:21 -0000 1.7 +++ jabber-keepalive.el 17 Sep 2007 12:26:16 -0000 1.8 @@ -84,7 +84,7 @@ (dolist (c jabber-connections) ;; Whether we get an error or not is not interesting. ;; Getting a response at all is. - (jabber-send-iq c jabber-server "get" + (jabber-send-iq c nil "get" '(query ((xmlns . "jabber:iq:time"))) 'jabber-keepalive-got-response nil 'jabber-keepalive-got-response nil))) Index: jabber-socks5.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-socks5.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- jabber-socks5.el 28 Apr 2007 14:34:57 -0000 1.16 +++ jabber-socks5.el 17 Sep 2007 12:26:16 -0000 1.17 @@ -146,7 +146,7 @@ (define-enter-state jabber-socks5 seek-proxies (fsm state-data) ;; Look for items at the server. (jabber-disco-get-items (plist-get state-data :jc) - jabber-server nil + nil nil (lambda (jc fsm result) (fsm-send-sync fsm (cons :items result))) fsm) Index: jabber-iq.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-iq.el,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- jabber-iq.el 31 Jul 2007 07:05:11 -0000 1.21 +++ jabber-iq.el 17 Sep 2007 12:26:16 -0000 1.22 @@ -161,7 +161,7 @@ (defun jabber-process-data (jc xml-data closure-data) "Process random results from various requests." - (let ((from (or (jabber-xml-get-attribute xml-data 'from) jabber-server)) + (let ((from (or (jabber-xml-get-attribute xml-data 'from) (plist-get (fsm-get-state-data jc) :server))) (xmlns (jabber-iq-xmlns xml-data)) (type (jabber-xml-get-attribute xml-data 'type))) (with-current-buffer (get-buffer-create (format-spec jabber-browse-buffer-format Index: jabber-conn.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-conn.el,v retrieving revision 2.11 retrieving revision 2.12 diff -u -d -r2.11 -r2.12 --- jabber-conn.el 14 Sep 2007 22:08:28 -0000 2.11 +++ jabber-conn.el 17 Sep 2007 12:26:16 -0000 2.12 @@ -47,20 +47,6 @@ (defgroup jabber-conn nil "Jabber Connection Settings" :group 'jabber) -(defcustom jabber-network-server nil - "hostname or IP address of server to connect to, if different from `jabber-server'." - :type '(radio (const :tag "Same as `jabber-server'" nil) - (string :tag "Hostname or IP address")) - :group 'jabber-conn) - -(defcustom jabber-port nil - "jabber port -The default depends on the connection type: 5222 for ordinary connections -and 5223 for SSL connections." - :type '(choice (const :tag "Default" nil) - (integer :tag "Port number")) - :group 'jabber-conn) - (defun jabber-have-starttls () "Return true if we can use STARTTLS." (and (featurep 'starttls) |
From: Magnus H. <leg...@us...> - 2007-09-17 12:26:11
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv23996 Modified Files: jabber-chat.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-413 Creator: Magnus Henoch <ma...@fr...> Don't use global variables in jabber-chat-self-prompt Index: jabber-chat.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chat.el,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- jabber-chat.el 15 Sep 2007 11:50:49 -0000 1.83 +++ jabber-chat.el 17 Sep 2007 12:26:07 -0000 1.84 @@ -104,8 +104,8 @@ %t Time, formatted according to `jabber-chat-time-format' or `jabber-chat-delayed-time-format' -%n Nickname (`jabber-nickname') %u Username +%n Nickname (obsolete, same as username) %r Resource %j Bare JID (without resource)" :type 'string @@ -476,21 +476,26 @@ If DELAYED is true, print long timestamp \(`jabber-chat-delayed-time-format' as opposed to `jabber-chat-time-format')." - (insert (jabber-propertize - (format-spec jabber-chat-local-prompt-format - (list - (cons ?t (format-time-string - (if delayed - jabber-chat-delayed-time-format - jabber-chat-time-format) - timestamp)) - (cons ?n jabber-nickname) - (cons ?u jabber-username) - (cons ?r jabber-resource) - (cons ?j (concat jabber-username "@" jabber-server)))) - 'face 'jabber-chat-prompt-local - 'help-echo - (concat (format-time-string "On %Y-%m-%d %H:%M:%S" timestamp) " from you")))) + (let* ((state-data (fsm-get-state-data jabber-buffer-connection)) + (username (plist-get state-data :username)) + (server (plist-get state-data :server)) + (resource (plist-get state-data :resource)) + (nickname username)) + (insert (jabber-propertize + (format-spec jabber-chat-local-prompt-format + (list + (cons ?t (format-time-string + (if delayed + jabber-chat-delayed-time-format + jabber-chat-time-format) + timestamp)) + (cons ?n nickname) + (cons ?u username) + (cons ?r resource) + (cons ?j (concat username "@" server)))) + 'face 'jabber-chat-prompt-local + 'help-echo + (concat (format-time-string "On %Y-%m-%d %H:%M:%S" timestamp) " from you"))))) (defun jabber-chat-print-error (xml-data) "Print error in given <message/> in a readable way." |
From: Magnus H. <leg...@us...> - 2007-09-17 12:17:20
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv19705 Modified Files: jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-412 Creator: Magnus Henoch <ma...@fr...> Don't use jabber-server in jabber-do-logon Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- jabber-logon.el 14 Sep 2007 22:08:28 -0000 1.16 +++ jabber-logon.el 17 Sep 2007 12:16:35 -0000 1.17 @@ -53,7 +53,7 @@ ;; If auth is still nil, user cancelled process somewhere (if auth - (jabber-send-iq jc jabber-server + (jabber-send-iq jc (plist-get (fsm-get-state-data jc) :server) "set" `(query ((xmlns . "jabber:iq:auth")) (username () ,(plist-get (fsm-get-state-data jc) :username)) |
From: Magnus H. <leg...@us...> - 2007-09-15 11:50:52
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv14855 Modified Files: jabber-chat.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-411 Creator: Magnus Henoch <ma...@fr...> Fix prompt display for subscription requests Index: jabber-chat.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chat.el,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- jabber-chat.el 14 Sep 2007 23:14:03 -0000 1.82 +++ jabber-chat.el 15 Sep 2007 11:50:49 -0000 1.83 @@ -349,13 +349,13 @@ (jabber-chat-self-prompt (or (jabber-x-delay original-timestamp) internal-time) delayed)) - ((:foreign :subscription-request) + (:foreign ;; For :error and :notice, this might be a string... beware (jabber-chat-print-prompt (when (listp (cadr data)) (cadr data)) (or (jabber-x-delay original-timestamp) internal-time) delayed)) - ((:error :notice) + ((:error :notice :subscription-request) (jabber-chat-system-prompt (or (jabber-x-delay original-timestamp) internal-time))) (:muc-local |
From: Magnus H. <leg...@us...> - 2007-09-14 23:14:15
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv8974 Modified Files: jabber-chat.el jabber-presence.el NEWS jabber-activity.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-410 Creator: Magnus Henoch <ma...@fr...> Subscription requests are sent to chat buffers Index: jabber-chat.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chat.el,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- jabber-chat.el 31 Aug 2007 21:45:03 -0000 1.81 +++ jabber-chat.el 14 Sep 2007 23:14:03 -0000 1.82 @@ -349,7 +349,7 @@ (jabber-chat-self-prompt (or (jabber-x-delay original-timestamp) internal-time) delayed)) - (:foreign + ((:foreign :subscription-request) ;; For :error and :notice, this might be a string... beware (jabber-chat-print-prompt (when (listp (cadr data)) (cadr data)) (or (jabber-x-delay original-timestamp) @@ -380,7 +380,24 @@ (insert (cadr data))) (:rare-time (insert (jabber-propertize (format-time-string jabber-rare-time-format (cadr data)) - 'face 'jabber-rare-time-face)))) + 'face 'jabber-rare-time-face))) + (:subscription-request + (insert "This user requests subscription to your presence.\n") + (when (and (stringp (cadr data)) (not (zerop (length (cadr data))))) + (insert "Message: " (cadr data) "\n")) + (insert "Accept?\n\n") + (flet ((button + (text action) + (if (fboundp 'insert-button) + (insert-button text 'action action) + ;; simple button replacement + (let ((keymap (make-keymap))) + (define-key keymap "\r" action) + (insert (jabber-propertize text 'keymap keymap 'face 'highlight)))) + (insert "\t"))) + (button "Mutual" 'jabber-subscription-accept-mutual) + (button "One-way" 'jabber-subscription-accept-one-way) + (button "Decline" 'jabber-subscription-decline)))) (when jabber-chat-fill-long-lines (save-restriction Index: NEWS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/NEWS,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- NEWS 24 Aug 2007 02:43:50 -0000 1.61 +++ NEWS 14 Sep 2007 23:14:03 -0000 1.62 @@ -29,6 +29,9 @@ See jabber-browse-buffer-format. (not documented yet) +** Subscription requests are sent to chat buffers +(not documented yet) + * New features in jabber.el 0.7.1 ** STARTTLS Index: jabber-activity.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-activity.el,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- jabber-activity.el 7 Aug 2007 17:02:19 -0000 1.29 +++ jabber-activity.el 14 Sep 2007 23:14:03 -0000 1.30 @@ -277,6 +277,12 @@ (add-to-list 'jabber-activity-jids group) (jabber-activity-mode-line-update))) +(defun jabber-activity-presence (who oldstatus newstatus statustext proposed-alert) + "Add a JID to mode line on subscription requests." + (when (string= newstatus "subscribe") + (add-to-list 'jabber-activity-jids (symbol-name who)) + (jabber-activity-mode-line-update))) + (defun jabber-activity-kill-hook () "Query the user as to whether killing Emacs should be cancelled when there are unread messages which otherwise would be lost, if @@ -327,6 +333,8 @@ 'jabber-activity-add) (add-hook 'jabber-muc-hooks 'jabber-activity-add-muc) + (add-hook 'jabber-presence-hooks + 'jabber-activity-presence) ;; XXX: reactivate ;; (add-hook 'jabber-post-connect-hooks ;; 'jabber-activity-make-name-alist) @@ -360,6 +368,8 @@ 'jabber-activity-add) (remove-hook 'jabber-muc-hooks 'jabber-activity-add-muc) + (remove-hook 'jabber-presence-hooks + 'jabber-activity-presence) ;; XXX: reactivate ;; (remove-hook 'jabber-post-connect-hooks ;; 'jabber-activity-make-name-alist) Index: jabber-presence.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-presence.el,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- jabber-presence.el 20 Mar 2007 11:49:41 -0000 1.33 +++ jabber-presence.el 14 Sep 2007 23:14:03 -0000 1.34 @@ -1,7 +1,7 @@ ;; jabber-presence.el - roster and presence bookkeeping +;; Copyright (C) 2003, 2004, 2007 - Magnus Henoch - ma...@fr... ;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in... -;; Copyright (C) 2003, 2004 - Magnus Henoch - ma...@fr... ;; This file is a part of jabber.el. @@ -193,23 +193,25 @@ (defun jabber-process-subscription-request (jc from presence-status) "process an incoming subscription request" - (dolist (hook '(jabber-presence-hooks jabber-alert-presence-hooks)) - (run-hook-with-args hook (jabber-jid-symbol from) nil "subscribe" presence-status (funcall jabber-alert-presence-message-function (jabber-jid-symbol from) nil "subscribe" presence-status))) - (jabber-send-sexp - jc - (list 'presence - (list (cons 'to from) - (cons 'type - (if (yes-or-no-p (format "the user - %s - has requested to subscribe to your presence (%s). allow? " - (jabber-jid-displayname from) - presence-status)) - "subscribed" - "unsubscribed"))))) - (when (yes-or-no-p (format "Do you want to subscribe to %s's presence? " from)) - (jabber-send-sexp - jc - (list 'presence (list (cons 'to from) - (cons 'type "subscribe")))))) + (with-current-buffer (jabber-chat-create-buffer jc from) + (ewoc-enter-last jabber-chat-ewoc (list :subscription-request presence-status :time (current-time))) + + (dolist (hook '(jabber-presence-hooks jabber-alert-presence-hooks)) + (run-hook-with-args hook (jabber-jid-symbol from) nil "subscribe" presence-status (funcall jabber-alert-presence-message-function (jabber-jid-symbol from) nil "subscribe" presence-status))))) + +(defun jabber-subscription-accept-mutual (&rest ignored) + (jabber-subscription-reply "subscribed" "subscribe")) + +(defun jabber-subscription-accept-one-way (&rest ignored) + (jabber-subscription-reply "subscribed")) + +(defun jabber-subscription-decline (&rest ignored) + (jabber-subscription-reply "unsubscribed")) + +(defun jabber-subscription-reply (&rest types) + (let ((to (jabber-jid-user jabber-chatting-with))) + (dolist (type types) + (jabber-send-sexp jabber-buffer-connection `(presence ((to . ,to) (type . ,type))))))) (defun jabber-prioritize-resources (buddy) "Set connected, show and status properties for BUDDY from highest-priority resource." |
From: Magnus H. <leg...@us...> - 2007-09-14 22:08:33
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv14418 Modified Files: jabber-conn.el jabber-core.el jabber-sasl.el jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-409 Creator: Magnus Henoch <ma...@fr...> Replace *jabber-encrypted* with per-account variable Index: jabber-sasl.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-sasl.el,v retrieving revision 2.12 retrieving revision 2.13 diff -u -d -r2.12 -r2.13 --- jabber-sasl.el 29 Aug 2007 01:45:36 -0000 2.12 +++ jabber-sasl.el 14 Sep 2007 22:08:28 -0000 2.13 @@ -60,7 +60,7 @@ (fsm-send jc :authentication-failure))) ;; Watch for plaintext logins over unencrypted connections - (if (and (not *jabber-encrypted*) + (if (and (not (plist-get (fsm-get-state-data jc) :encrypted)) (member (sasl-mechanism-name mechanism) '("PLAIN" "LOGIN")) (not (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? "))) Index: jabber-conn.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-conn.el,v retrieving revision 2.10 retrieving revision 2.11 diff -u -d -r2.10 -r2.11 --- jabber-conn.el 29 Aug 2007 12:58:28 -0000 2.10 +++ jabber-conn.el 14 Sep 2007 22:08:28 -0000 2.11 @@ -175,7 +175,6 @@ 'open-ssl-stream) (t (error "Neither TLS nor SSL connect functions available"))))) - (setq *jabber-encrypted* t) (let ((connection (funcall connect-function "jabber" Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- jabber-logon.el 29 Aug 2007 01:45:36 -0000 1.15 +++ jabber-logon.el 14 Sep 2007 22:08:28 -0000 1.16 @@ -45,7 +45,7 @@ (if passwd (setq auth `(digest () ,(sha1 (concat session-id passwd)))))) ;; Plaintext passwords - allow on encrypted connections - (if (or *jabber-encrypted* + (if (or (plist-get (fsm-get-state-data jc) :encrypted) (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? ")) (let ((passwd (jabber-read-password (jabber-connection-bare-jid jc)))) (when passwd Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- jabber-core.el 3 Sep 2007 17:17:34 -0000 1.69 +++ jabber-core.el 14 Sep 2007 22:08:28 -0000 1.70 @@ -46,9 +46,6 @@ (defvar *jabber-authenticated* nil "boolean - are we authenticated") -(defvar *jabber-encrypted* nil - "boolean - is the connection encrypted") - (defvar *jabber-disconnecting* nil "boolean - are we in the process of disconnecting by free will") @@ -241,7 +238,8 @@ :resource resource :password password :registerp registerp - :connection-type connection-type))))) + :connection-type connection-type + :encrypted (eq connection-type 'ssl)))))) (define-enter-state jabber-connection nil (fsm state-data) @@ -415,8 +413,7 @@ (:stanza (if (jabber-starttls-process-input fsm (cadr event)) ;; Connection is encrypted. Send a stream tag again. - ;; XXX: note encryptedness of connection. - (list :connected state-data) + (list :connected (plist-put state-data :encrypted t)) (message "STARTTLS negotiation failed") (list nil state-data))) @@ -698,7 +695,6 @@ (setq *jabber-connection* nil) (jabber-clear-roster) (setq *jabber-authenticated* nil) - (setq *jabber-encrypted* nil) (setq *jabber-connected* nil) (setq *jabber-active-groupchats* nil) (run-hooks 'jabber-post-disconnect-hook)) |
From: Magnus H. <leg...@us...> - 2007-09-09 14:06:20
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv17933 Modified Files: jabber-chatstates.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-408 Creator: Magnus Henoch <ma...@fr...> Obey jabber-chatstates-requested (Still need to set it to nil somewhere) Index: jabber-chatstates.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chatstates.el,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jabber-chatstates.el 24 Aug 2007 01:36:06 -0000 1.1 +++ jabber-chatstates.el 9 Sep 2007 14:06:11 -0000 1.2 @@ -54,7 +54,8 @@ (defun jabber-chatstates-when-sending (text id) (jabber-chatstates-update-message) (jabber-chatstates-stop-timer) - `((active ((xmlns . ,jabber-chatstates-xmlns))))) + (when jabber-chatstates-requested + `((active ((xmlns . ,jabber-chatstates-xmlns)))))) ;;; OUTGOING ;;; Code for handling requests for chat state notifications and providing @@ -91,7 +92,7 @@ (defun jabber-chatstates-send-paused () "Send an 'paused state notification." - (when jabber-chatting-with + (when (and jabber-chatstates-requested jabber-chatting-with) (setq jabber-chatstates-composing-sent nil) (jabber-send-sexp jabber-buffer-connection @@ -104,6 +105,7 @@ (state (if composing-now 'composing 'active))) (when (and jabber-chatstates-confirm jabber-chatting-with + jabber-chatstates-requested (not (eq composing-now jabber-chatstates-composing-sent))) (jabber-send-sexp jabber-buffer-connection |
From: Magnus H. <leg...@us...> - 2007-09-03 17:17:50
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv29015 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-407 Creator: Magnus Henoch <ma...@fr...> Adapt interactive spec of jabber-connect to alist form of jabber-account-list Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- jabber-core.el 3 Sep 2007 17:14:52 -0000 1.68 +++ jabber-core.el 3 Sep 2007 17:17:34 -0000 1.69 @@ -165,6 +165,7 @@ (interactive (let* ((jid (completing-read "Enter your JID: " jabber-account-list)) (entry (assoc jid jabber-account-list)) + (alist (cdr entry)) password network-server port connection-type registerp) (flet ((nonempty (s) @@ -172,10 +173,10 @@ (when entry ;; If the user entered the JID of one of the preconfigured ;; accounts, use that data. - (setq password (nonempty (nth 1 entry))) - (setq network-server (nonempty (nth 2 entry))) - (setq port (nth 3 entry)) - (setq connection-type (nth 4 entry))) + (setq password (cdr (assq :password alist))) + (setq network-server (cdr (assq :network-server alist))) + (setq port (cdr (assq :port alist))) + (setq connection-type (cdr (assq :connection-type alist)))) (when (equal current-prefix-arg '(16)) ;; Double prefix arg: ask about everything. ;; (except password, which is asked about later anyway) |
From: Magnus H. <leg...@us...> - 2007-09-03 17:14:56
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv27816 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-406 Creator: Magnus Henoch <ma...@fr...> Revert previous patch to jabber-connect Those variables were inside the interactive clause, and therefore not a shadowing problem at all. Don't drink and code! Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- jabber-core.el 1 Sep 2007 02:39:14 -0000 1.67 +++ jabber-core.el 3 Sep 2007 17:14:52 -0000 1.68 @@ -164,7 +164,8 @@ With double prefix argument, specify more connection details." (interactive (let* ((jid (completing-read "Enter your JID: " jabber-account-list)) - (entry (assoc jid jabber-account-list))) + (entry (assoc jid jabber-account-list)) + password network-server port connection-type registerp) (flet ((nonempty (s) (unless (zerop (length s)) s))) |
From: Magnus H. <leg...@us...> - 2007-09-01 15:58:31
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv14425 Modified Files: jabber.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-405 Creator: Magnus Henoch <ma...@fr...> Better docstring for jabber-account-list Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- jabber.el 1 Sep 2007 02:39:14 -0000 1.78 +++ jabber.el 1 Sep 2007 15:58:16 -0000 1.79 @@ -46,7 +46,21 @@ :connection-type is a symbol. Valid symbols are `starttls', `network' and `ssl'. -Only JID is mandatory. The rest can be guessed at run-time." +Only JID is mandatory. The rest can be guessed at run-time. + +Examples: + +Two accounts without any special configuration: +\((\"fo...@ex...\") (\"ba...@ex...\")) + +One disabled account with a non-standard port: +\((\"ro...@mo...\" (:port . 5242) (:disabled . t))) + +If you don't have SRV and STARTTLS capabilities in your Emacs, +configure a Google Talk account like this: +\((\"use...@gm...\" + (:network-server . \"talk.google.com\") + (:connection-type . ssl)))" :type '(repeat (cons :tag "Account information" (string :tag "JID") |
From: Magnus H. <leg...@us...> - 2007-09-01 02:39:21
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv28214 Modified Files: jabber.el jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-404 Creator: Magnus Henoch <ma...@fr...> Add option for disabling accounts in jabber-account-list Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- jabber-core.el 1 Sep 2007 02:39:04 -0000 1.66 +++ jabber-core.el 1 Sep 2007 02:39:14 -0000 1.67 @@ -22,7 +22,7 @@ ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -(eval-when-compile (require 'cl)) +(require 'cl) (require 'jabber-util) (require 'jabber-logon) @@ -132,25 +132,29 @@ See `jabber-account-list'. If no accounts are configured, call `jabber-connect' interactively." (interactive) - (if (null jabber-account-list) - (call-interactively 'jabber-connect) - ;; Only connect those accounts that are not yet connected. - (let ((already-connected (mapcar #'jabber-connection-bare-jid jabber-connections)) - (connected-one nil)) - (dolist (account jabber-account-list) - (unless (member (jabber-jid-user (car account)) already-connected) - (let* ((jid (car account)) - (alist (cdr account)) - (password (cdr (assq :password alist))) - (network-server (cdr (assq :network-server alist))) - (port (cdr (assq :port alist))) - (connection-type (cdr (assq :connection-type alist)))) - (jabber-connect - (jabber-jid-username jid) - (jabber-jid-server jid) - (jabber-jid-resource jid) - nil password network-server - port connection-type))))))) + (let ((accounts + (remove-if (lambda (account) + (cdr (assq :disabled (cdr account)))) + jabber-account-list))) + (if (null accounts) + (call-interactively 'jabber-connect) + ;; Only connect those accounts that are not yet connected. + (let ((already-connected (mapcar #'jabber-connection-bare-jid jabber-connections)) + (connected-one nil)) + (dolist (account accounts) + (unless (member (jabber-jid-user (car account)) already-connected) + (let* ((jid (car account)) + (alist (cdr account)) + (password (cdr (assq :password alist))) + (network-server (cdr (assq :network-server alist))) + (port (cdr (assq :port alist))) + (connection-type (cdr (assq :connection-type alist)))) + (jabber-connect + (jabber-jid-username jid) + (jabber-jid-server jid) + (jabber-jid-resource jid) + nil password network-server + port connection-type)))))))) (defun jabber-connect (username server resource &optional registerp password network-server Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- jabber.el 1 Sep 2007 02:38:54 -0000 1.77 +++ jabber.el 1 Sep 2007 02:39:14 -0000 1.78 @@ -52,6 +52,9 @@ (string :tag "JID") (set :format "%v" (cons :format "%v" + (const :format "" :disabled) + (const :tag "Disabled" t)) + (cons :format "%v" (const :format "" :password) (string :tag "Password")) (cons :format "%v" |
From: Magnus H. <leg...@us...> - 2007-09-01 02:39:13
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv28095 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-403 Creator: Magnus Henoch <ma...@fr...> Make jabber-connect obey its arguments Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- jabber-core.el 1 Sep 2007 02:38:54 -0000 1.65 +++ jabber-core.el 1 Sep 2007 02:39:04 -0000 1.66 @@ -160,8 +160,7 @@ With double prefix argument, specify more connection details." (interactive (let* ((jid (completing-read "Enter your JID: " jabber-account-list)) - (entry (assoc jid jabber-account-list)) - password network-server port connection-type registerp) + (entry (assoc jid jabber-account-list))) (flet ((nonempty (s) (unless (zerop (length s)) s))) |
From: Magnus H. <leg...@us...> - 2007-09-01 02:39:05
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv27829 Modified Files: jabber.el jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-402 Creator: Magnus Henoch <ma...@fr...> Make jabber-account-list into an alist, for extensibility Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- jabber-core.el 29 Aug 2007 13:03:41 -0000 1.64 +++ jabber-core.el 1 Sep 2007 02:38:54 -0000 1.65 @@ -137,19 +137,20 @@ ;; Only connect those accounts that are not yet connected. (let ((already-connected (mapcar #'jabber-connection-bare-jid jabber-connections)) (connected-one nil)) - (flet ((nonempty - (s) - (unless (zerop (length s)) s))) - (dolist (account jabber-account-list) - (unless (member (jabber-jid-user (car account)) already-connected) - (destructuring-bind (jid password network-server port connection-type) - account - (jabber-connect - (jabber-jid-username jid) - (jabber-jid-server jid) - (jabber-jid-resource jid) - nil (nonempty password) (nonempty network-server) - port connection-type)))))))) + (dolist (account jabber-account-list) + (unless (member (jabber-jid-user (car account)) already-connected) + (let* ((jid (car account)) + (alist (cdr account)) + (password (cdr (assq :password alist))) + (network-server (cdr (assq :network-server alist))) + (port (cdr (assq :port alist))) + (connection-type (cdr (assq :connection-type alist)))) + (jabber-connect + (jabber-jid-username jid) + (jabber-jid-server jid) + (jabber-jid-resource jid) + nil password network-server + port connection-type))))))) (defun jabber-connect (username server resource &optional registerp password network-server Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- jabber.el 29 Aug 2007 01:45:36 -0000 1.76 +++ jabber.el 1 Sep 2007 02:38:54 -0000 1.77 @@ -32,38 +32,42 @@ (defcustom jabber-account-list nil "List of Jabber accounts. -Each element of the list is a list describing a Jabber account -of the form (JID PASSWORD NETWORK-SERVER PORT CONNECTION-TYPE). +Each element of the list is a cons cell describing a Jabber account, +where the car is a JID and the CDR is an alist. JID is a full Jabber ID string (e.g. fo...@ba...d). You can also specify the resource (e.g. fo...@ba...d/emacs). -PASSWORD is a string to authenticate ourself against the server. +The following keys can be present in the alist: +:password is a string to authenticate ourself against the server. It can be empty. -NETWORK-SERVER is a string identifying the address to connect to, +:network-server is a string identifying the address to connect to, if it's different from the server part of the JID. -PORT is the port to use (default depends on connection type). -CONNECTION-TYPE is a symbol. Valid symbols are `starttls', +:port is the port to use (default depends on connection type). +:connection-type is a symbol. Valid symbols are `starttls', `network' and `ssl'. -Only JID is mandatory. The rest can be guessed at run-time. - -Example: - ((\"xm...@ja.../emacs\" \"\" \"\" nil network) - (\"xm...@gm...\" \"\" \"talk.google.com\" 5223 ssl))" +Only JID is mandatory. The rest can be guessed at run-time." :type '(repeat - (list :tag "Account information" + (cons :tag "Account information" (string :tag "JID") - (string :tag "Password") - (string :tag "Network server") - (choice :tag "Port" - (const :tag "Default" nil) - (integer :tag "Override" 5222)) - (choice :tag "Connection type" - ;; XXX: detect whether we have STARTTLS? option - ;; for enforcing encryption? - (const :tag "STARTTLS" starttls) - (const :tag "Unencrypted" network) - (const :tag "Legacy SSL/TLS" ssl)))) + (set :format "%v" + (cons :format "%v" + (const :format "" :password) + (string :tag "Password")) + (cons :format "%v" + (const :format "" :network-server) + (string :tag "Network server")) + (cons :format "%v" + (const :format "" :port) + (integer :tag "Port" 5222)) + (cons :format "%v" + (const :format "" :connection-type) + (choice :tag "Connection type" + ;; XXX: detect whether we have STARTTLS? option + ;; for enforcing encryption? + (const :tag "STARTTLS" starttls) + (const :tag "Unencrypted" network) + (const :tag "Legacy SSL/TLS" ssl)))))) :group 'jabber-core) ;; XXX: kill these four variables |
From: Magnus H. <leg...@us...> - 2007-08-31 21:45:20
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv10375 Modified Files: jabber-util.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-401 Creator: Magnus Henoch <ma...@fr...> Use COPY-SEQUENCE when reading password from cache Index: jabber-util.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-util.el,v retrieving revision 2.50 retrieving revision 2.51 diff -u -d -r2.50 -r2.51 --- jabber-util.el 29 Aug 2007 01:45:36 -0000 2.50 +++ jabber-util.el 31 Aug 2007 21:45:12 -0000 2.51 @@ -270,7 +270,8 @@ (copy-sequence jabber-password) (let ((prompt (format "Jabber password for %s: " bare-jid))) (if (fboundp 'password-read-and-add) - (password-read-and-add prompt (jabber-password-key bare-jid)) + (copy-sequence + (password-read-and-add prompt (jabber-password-key bare-jid))) (read-passwd prompt))))) (defun jabber-uncache-password (bare-jid) |
From: Magnus H. <leg...@us...> - 2007-08-31 21:45:10
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv10092 Modified Files: jabber-chat.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-400 Creator: Magnus Henoch <ma...@fr...> Ignore goto-address errors Index: jabber-chat.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chat.el,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- jabber-chat.el 24 Aug 2007 01:36:06 -0000 1.80 +++ jabber-chat.el 31 Aug 2007 21:45:03 -0000 1.81 @@ -556,7 +556,8 @@ (defun jabber-chat-goto-address (&rest ignore) "Call `goto-address' on the newly written text." - (goto-address)) + (ignore-errors + (goto-address))) ;; jabber-compose is autoloaded in jabber.el (add-to-list 'jabber-jid-chat-menu |
From: Magnus H. <leg...@us...> - 2007-08-30 09:24:41
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv18390 Modified Files: jabber-history.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-399 Creator: Magnus Henoch <ma...@fr...> jabber-history-backlog shouldn't be interactive Index: jabber-history.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-history.el,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- jabber-history.el 5 Jun 2007 16:29:16 -0000 1.28 +++ jabber-history.el 30 Aug 2007 09:24:37 -0000 1.29 @@ -233,7 +233,6 @@ If BEFORE is non-nil, it should be a float-time after which no entries will be fetched. `jabber-backlog-days' still applies, though." - (interactive) (jabber-history-query (and jabber-backlog-days (- (jabber-float-time) (* jabber-backlog-days 86400.0))) |
From: Magnus H. <leg...@us...> - 2007-08-29 13:03:47
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv18621 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-398 Creator: Magnus Henoch <ma...@fr...> Save connection type in state data, and use instead of global variable Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- jabber-core.el 29 Aug 2007 01:45:36 -0000 1.63 +++ jabber-core.el 29 Aug 2007 13:03:41 -0000 1.64 @@ -234,7 +234,8 @@ :server server :resource resource :password password - :registerp registerp))))) + :registerp registerp + :connection-type connection-type))))) (define-enter-state jabber-connection nil (fsm state-data) @@ -372,7 +373,7 @@ :disconnection-reason (format "Unexpected stanza %s" stanza)))) ((and (jabber-xml-get-children stanza 'starttls) - (eq jabber-connection-type 'starttls)) + (eq (plist-get state-data :connection-type) 'starttls)) (list :starttls state-data)) ;; XXX: require encryption for registration? ((plist-get state-data :registerp) |
From: Magnus H. <leg...@us...> - 2007-08-29 12:58:37
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv16539 Modified Files: jabber-conn.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-397 Creator: Magnus Henoch <ma...@fr...> Fix jabber-get-{connect,send}-function Have jabber-get-connect-function and jabber-get-send-function use their argument instead of the removed global variable jabber-connection-type. Index: jabber-conn.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-conn.el,v retrieving revision 2.9 retrieving revision 2.10 diff -u -d -r2.9 -r2.10 --- jabber-conn.el 29 Aug 2007 01:45:36 -0000 2.9 +++ jabber-conn.el 29 Aug 2007 12:58:28 -0000 2.10 @@ -102,13 +102,13 @@ (defun jabber-get-connect-function (type) "Get the connect function associated with TYPE. TYPE is a symbol; see `jabber-connection-type'." - (let ((entry (assq jabber-connection-type jabber-connect-methods))) + (let ((entry (assq type jabber-connect-methods))) (nth 1 entry))) (defun jabber-get-send-function (type) "Get the send function associated with TYPE. TYPE is a symbol; see `jabber-connection-type'." - (let ((entry (assq jabber-connection-type jabber-connect-methods))) + (let ((entry (assq type jabber-connect-methods))) (nth 2 entry))) (defun jabber-srv-targets (server network-server port) |
From: Magnus H. <leg...@us...> - 2007-08-29 01:45:44
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv10930 Modified Files: jabber-conn.el jabber.el jabber-core.el jabber-sasl.el jabber-keymap.el jabber-util.el jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-396 Creator: Magnus Henoch <ma...@fr...> Add customization option for multiple accounts Based on a patch by Xavier Maillard. Index: jabber-sasl.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-sasl.el,v retrieving revision 2.11 retrieving revision 2.12 diff -u -d -r2.11 -r2.12 --- jabber-sasl.el 24 Aug 2007 03:12:14 -0000 2.11 +++ jabber-sasl.el 29 Aug 2007 01:45:36 -0000 2.12 @@ -81,9 +81,11 @@ (cons client step)))))) (defun jabber-sasl-process-input (jc xml-data sasl-data) - (let ((sasl-read-passphrase (lexical-let ((bare-jid (jabber-connection-bare-jid jc))) - (lambda (prompt) - (jabber-read-password bare-jid prompt)))) + (let ((sasl-read-passphrase (lexical-let ((password (plist-get (fsm-get-state-data jc) :password)) + (bare-jid (jabber-connection-bare-jid jc))) + (if password + (lambda (prompt) password) + (lambda (prompt) (jabber-read-password bare-jid))))) (client (car sasl-data)) (step (cdr sasl-data))) (cond Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- jabber.el 24 Aug 2007 01:36:05 -0000 1.75 +++ jabber.el 29 Aug 2007 01:45:36 -0000 1.76 @@ -30,6 +30,43 @@ (defgroup jabber nil "Jabber instant messaging" :group 'applications) +(defcustom jabber-account-list nil + "List of Jabber accounts. +Each element of the list is a list describing a Jabber account +of the form (JID PASSWORD NETWORK-SERVER PORT CONNECTION-TYPE). + +JID is a full Jabber ID string (e.g. fo...@ba...d). You can also +specify the resource (e.g. fo...@ba...d/emacs). +PASSWORD is a string to authenticate ourself against the server. +It can be empty. +NETWORK-SERVER is a string identifying the address to connect to, +if it's different from the server part of the JID. +PORT is the port to use (default depends on connection type). +CONNECTION-TYPE is a symbol. Valid symbols are `starttls', +`network' and `ssl'. + +Only JID is mandatory. The rest can be guessed at run-time. + +Example: + ((\"xm...@ja.../emacs\" \"\" \"\" nil network) + (\"xm...@gm...\" \"\" \"talk.google.com\" 5223 ssl))" + :type '(repeat + (list :tag "Account information" + (string :tag "JID") + (string :tag "Password") + (string :tag "Network server") + (choice :tag "Port" + (const :tag "Default" nil) + (integer :tag "Override" 5222)) + (choice :tag "Connection type" + ;; XXX: detect whether we have STARTTLS? option + ;; for enforcing encryption? + (const :tag "STARTTLS" starttls) + (const :tag "Unencrypted" network) + (const :tag "Legacy SSL/TLS" ssl)))) + :group 'jabber-core) + +;; XXX: kill these four variables (defcustom jabber-username "emacs" "jabber username (user part of JID)" :type 'string @@ -70,6 +107,7 @@ :type 'integer :group 'jabber) +;; XXX: kill this one too (defcustom jabber-nickname jabber-username "jabber nickname, used in chat buffer prompts and as default groupchat nickname." :type 'string Index: jabber-util.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-util.el,v retrieving revision 2.49 retrieving revision 2.50 diff -u -d -r2.49 -r2.50 --- jabber-util.el 24 Aug 2007 02:43:50 -0000 2.49 +++ jabber-util.el 29 Aug 2007 01:45:36 -0000 2.50 @@ -260,7 +260,7 @@ "Construct key for `password' library from BARE-JID." (concat "xmpp:" bare-jid)) -(defun jabber-read-password (bare-jid &optional prompt) +(defun jabber-read-password (bare-jid) "Read Jabber password, either from customized variable or from minibuffer. See `jabber-password'." (if jabber-password @@ -268,7 +268,7 @@ ;; variable jabber-password is a high-convenience low-security ;; alternative anyway. (copy-sequence jabber-password) - (let ((prompt (or prompt (format "Jabber password for %s: " bare-jid)))) + (let ((prompt (format "Jabber password for %s: " bare-jid))) (if (fboundp 'password-read-and-add) (password-read-and-add prompt (jabber-password-key bare-jid)) (read-passwd prompt))))) Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- jabber-core.el 28 Aug 2007 16:28:29 -0000 1.62 +++ jabber-core.el 29 Aug 2007 01:45:36 -0000 1.63 @@ -127,29 +127,77 @@ "Return non-nil if SASL functions are available." (featurep 'sasl)) -(defun jabber-connect (username server resource &optional registerp) - "connect to the jabber server and start a jabber xml stream -With prefix argument, register a new account." +(defun jabber-connect-all () + "Connect to all configured Jabber accounts. +See `jabber-account-list'. +If no accounts are configured, call `jabber-connect' interactively." + (interactive) + (if (null jabber-account-list) + (call-interactively 'jabber-connect) + ;; Only connect those accounts that are not yet connected. + (let ((already-connected (mapcar #'jabber-connection-bare-jid jabber-connections)) + (connected-one nil)) + (flet ((nonempty + (s) + (unless (zerop (length s)) s))) + (dolist (account jabber-account-list) + (unless (member (jabber-jid-user (car account)) already-connected) + (destructuring-bind (jid password network-server port connection-type) + account + (jabber-connect + (jabber-jid-username jid) + (jabber-jid-server jid) + (jabber-jid-resource jid) + nil (nonempty password) (nonempty network-server) + port connection-type)))))))) + +(defun jabber-connect (username server resource &optional + registerp password network-server + port connection-type) + "Connect to the Jabber server and start a Jabber XML stream. +With prefix argument, register a new account. +With double prefix argument, specify more connection details." (interactive - (let* ((default (when (and jabber-username jabber-server) - (if jabber-resource - (format "%s@%s/%s" - jabber-username - jabber-server - jabber-resource) - (format "%s@%s" - jabber-username - jabber-server)))) - (jid (read-string - (if default - (format "Enter your JID: (default %s) " default) - "Enter your JID: ") - nil nil default))) - (list (jabber-jid-username jid) - (jabber-jid-server jid) - (or (jabber-jid-resource jid) jabber-resource) - current-prefix-arg))) - ;; XXX: better way of specifying which account(s) to connect to. + (let* ((jid (completing-read "Enter your JID: " jabber-account-list)) + (entry (assoc jid jabber-account-list)) + password network-server port connection-type registerp) + (flet ((nonempty + (s) + (unless (zerop (length s)) s))) + (when entry + ;; If the user entered the JID of one of the preconfigured + ;; accounts, use that data. + (setq password (nonempty (nth 1 entry))) + (setq network-server (nonempty (nth 2 entry))) + (setq port (nth 3 entry)) + (setq connection-type (nth 4 entry))) + (when (equal current-prefix-arg '(16)) + ;; Double prefix arg: ask about everything. + ;; (except password, which is asked about later anyway) + (setq password nil) + (setq network-server + (read-string (format "Network server: (default `%s') " network-server) + nil nil network-server)) + (setq port + (car + (read-from-string + (read-string (format "Port: (default `%s') " port) + nil nil (if port (number-to-string port) "nil"))))) + (setq connection-type + (car + (read-from-string + (or (nonempty (completing-read + (format "Connection type: (default `%s') " connection-type) + '(("starttls" "network" "ssl")) t)) + (symbol-name connection-type))))) + (setq registerp (yes-or-no-p "Register new account? "))) + (when (equal current-prefix-arg '(4)) + (setq registerp t)) + + (list (jabber-jid-username jid) + (jabber-jid-server jid) + (jabber-jid-resource jid) + registerp password network-server port connection-type)))) (if (member (list username server) (mapcar @@ -164,26 +212,28 @@ ;;(jabber-clear-roster) (jabber-reset-choked) - (push (start-jabber-connection username - server - resource - registerp) + (push (start-jabber-connection username server resource + registerp password + network-server port connection-type) jabber-connections))) (define-state-machine jabber-connection - :start ((username server resource &optional registerp) + :start ((username server resource registerp password network-server port connection-type) "Start a Jabber connection." - (let ((connect-function - (jabber-get-connect-function jabber-connection-type)) + (let* ((connection-type + (or connection-type jabber-default-connection-type)) + (connect-function + (jabber-get-connect-function connection-type)) (send-function - (jabber-get-send-function jabber-connection-type))) - (funcall connect-function fsm server) + (jabber-get-send-function connection-type))) + (funcall connect-function fsm server network-server port) (list :connecting (list :send-function send-function :username username :server server :resource resource + :password password :registerp registerp))))) (define-enter-state jabber-connection nil Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- jabber-logon.el 24 Aug 2007 03:12:14 -0000 1.14 +++ jabber-logon.el 29 Aug 2007 01:45:36 -0000 1.15 @@ -40,7 +40,8 @@ (let (auth) (if (jabber-xml-get-children (jabber-iq-query xml-data) 'digest) ;; SHA1 digest passwords allowed - (let ((passwd (jabber-read-password (jabber-connection-bare-jid jc)))) + (let ((passwd (or (plist-get (fsm-get-state-data jc) :password) + (jabber-read-password (jabber-connection-bare-jid jc))))) (if passwd (setq auth `(digest () ,(sha1 (concat session-id passwd)))))) ;; Plaintext passwords - allow on encrypted connections Index: jabber-keymap.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-keymap.el,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- jabber-keymap.el 15 Apr 2007 23:53:09 -0000 1.9 +++ jabber-keymap.el 29 Aug 2007 01:45:36 -0000 1.10 @@ -41,7 +41,7 @@ (defvar jabber-global-keymap (let ((map (make-sparse-keymap))) - (define-key map "\C-c" 'jabber-connect) + (define-key map "\C-c" 'jabber-connect-all) (define-key map "\C-d" 'jabber-disconnect) (define-key map "\C-r" 'jabber-switch-to-roster-buffer) (define-key map "\C-j" 'jabber-chat-with) Index: jabber-conn.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-conn.el,v retrieving revision 2.8 retrieving revision 2.9 diff -u -d -r2.8 -r2.9 --- jabber-conn.el 5 Feb 2007 21:59:02 -0000 2.8 +++ jabber-conn.el 29 Aug 2007 01:45:36 -0000 2.9 @@ -61,23 +61,24 @@ (integer :tag "Port number")) :group 'jabber-conn) -(defcustom jabber-connection-type +(defun jabber-have-starttls () + "Return true if we can use STARTTLS." + (and (featurep 'starttls) + (or (and (bound-and-true-p starttls-gnutls-program) + (executable-find starttls-gnutls-program)) + (and (bound-and-true-p starttls-program) + (executable-find starttls-program))))) + +(defconst jabber-default-connection-type (cond ;; Use STARTTLS if we can... - ((and (featurep 'starttls) - (or (and (bound-and-true-p starttls-gnutls-program) - (executable-find starttls-gnutls-program)) - (and (bound-and-true-p starttls-program) - (executable-find starttls-program)))) + ((jabber-have-starttls) 'starttls) ;; ...else default to unencrypted connection. (t 'network)) - "Type of connection to the jabber server, ssl or network most likely." - :type '(radio (const :tag "Encrypted connection, SSL" ssl) - (const :tag "Negotiate encrypted connection when available (STARTTLS)" starttls) - (const :tag "Standard TCP/IP connection" network)) - :group 'jabber-conn) + "Default connection type. +See `jabber-connect-methods'.") (defcustom jabber-connection-ssl-program nil "Program used for SSL/TLS connections. @@ -110,21 +111,21 @@ (let ((entry (assq jabber-connection-type jabber-connect-methods))) (nth 2 entry))) -(defun jabber-srv-targets (server) +(defun jabber-srv-targets (server network-server port) "Find host and port to connect to. +If NETWORK-SERVER and/or PORT are specified, use them. If we can't find SRV records, use standard defaults." - ;; XXX: per account ;; If the user has specified a host or a port, obey that. - (if (or jabber-network-server jabber-port) - (list (cons (or jabber-network-server server) - (or jabber-port 5222))) + (if (or network-server port) + (list (cons (or network-server server) + (or port 5222))) (or (condition-case nil (srv-lookup (concat "_xmpp-client._tcp." server)) (error nil)) (list (cons server 5222))))) ;; Plain TCP/IP connection -(defun jabber-network-connect (fsm server) +(defun jabber-network-connect (fsm server network-server port) "Connect to a Jabber server with a plain network connection. Send a message of the form (:connected CONNECTION) to FSM if connection succeeds. Send a message :connection-failed if @@ -132,7 +133,7 @@ ;; XXX: asynchronous connection (let ((coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) - (targets (jabber-srv-targets server))) + (targets (jabber-srv-targets server network-server port))) (catch 'connected (dolist (target targets) (condition-case e @@ -157,7 +158,7 @@ ;; SSL connection, we use openssl's s_client function for encryption ;; of the link ;; TODO: make this configurable -(defun jabber-ssl-connect (fsm server) +(defun jabber-ssl-connect (fsm server network-server port) "connect via OpenSSL or GnuTLS to a Jabber Server Send a message of the form (:connected CONNECTION) to FSM if connection succeeds. Send a message :connection-failed if @@ -179,8 +180,8 @@ (funcall connect-function "jabber" (generate-new-buffer jabber-process-buffer) - (or jabber-network-server server) - (or jabber-port 5223)))) + (or network-server server) + (or port 5223)))) (if connection (fsm-send fsm (list :connected connection)) (fsm-send fsm :connection-failed))))) @@ -191,14 +192,14 @@ (process-send-string connection string) (process-send-string connection "\n")) -(defun jabber-starttls-connect (fsm server) +(defun jabber-starttls-connect (fsm server network-server port) "Connect via GnuTLS to a Jabber Server. Send a message of the form (:connected CONNECTION) to FSM if connection succeeds. Send a message :connection-failed if connection fails." (let ((coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) - (targets (jabber-srv-targets server))) + (targets (jabber-srv-targets server network-server port))) (unless (fboundp 'starttls-open-stream) (error "starttls.el not available")) (catch 'connected |
From: Magnus H. <leg...@us...> - 2007-08-28 16:28:34
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv12240 Modified Files: jabber-core.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-395 Creator: Magnus Henoch <ma...@fr...> Allow disconnection in all states Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- jabber-core.el 24 Aug 2007 02:43:50 -0000 1.61 +++ jabber-core.el 28 Aug 2007 16:28:29 -0000 1.62 @@ -361,7 +361,12 @@ ;; XXX: note encryptedness of connection. (list :connected state-data) (message "STARTTLS negotiation failed") - (list nil state-data))))) + (list nil state-data))) + + (:do-disconnect + (jabber-send-string fsm "</stream:stream>") + (list nil (plist-put state-data + :disconnection-expected t))))) (define-enter-state jabber-connection :register-account (fsm state-data) @@ -419,6 +424,11 @@ (:authentication-failure ;; jabber-logon has already displayed a message (list nil (plist-put state-data + :disconnection-expected t))) + + (:do-disconnect + (jabber-send-string fsm "</stream:stream>") + (list nil (plist-put state-data :disconnection-expected t))))) (define-enter-state jabber-connection :sasl-auth @@ -460,6 +470,11 @@ (:authentication-failure ;; jabber-sasl has already displayed a message (list nil (plist-put state-data + :disconnection-expected t))) + + (:do-disconnect + (jabber-send-string fsm "</stream:stream>") + (list nil (plist-put state-data :disconnection-expected t))))) (define-enter-state jabber-connection :bind @@ -546,7 +561,12 @@ (message "Session establishing failed: %s" (jabber-parse-error (jabber-iq-error (cadr event)))) - (list nil state-data)))) + (list nil state-data)) + + (:do-disconnect + (jabber-send-string fsm "</stream:stream>") + (list nil (plist-put state-data + :disconnection-expected t))))) (define-enter-state jabber-connection :session-established (fsm state-data) |
From: Magnus H. <leg...@us...> - 2007-08-24 03:12:17
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv5957 Modified Files: jabber-sasl.el jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-394 Creator: Magnus Henoch <ma...@fr...> Fix password reading functions Index: jabber-sasl.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-sasl.el,v retrieving revision 2.10 retrieving revision 2.11 diff -u -d -r2.10 -r2.11 --- jabber-sasl.el 24 Aug 2007 02:43:50 -0000 2.10 +++ jabber-sasl.el 24 Aug 2007 03:12:14 -0000 2.11 @@ -81,7 +81,9 @@ (cons client step)))))) (defun jabber-sasl-process-input (jc xml-data sasl-data) - (let ((sasl-read-passphrase #'jabber-read-password) + (let ((sasl-read-passphrase (lexical-let ((bare-jid (jabber-connection-bare-jid jc))) + (lambda (prompt) + (jabber-read-password bare-jid prompt)))) (client (car sasl-data)) (step (cdr sasl-data))) (cond Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- jabber-logon.el 24 Aug 2007 02:43:50 -0000 1.13 +++ jabber-logon.el 24 Aug 2007 03:12:14 -0000 1.14 @@ -40,13 +40,13 @@ (let (auth) (if (jabber-xml-get-children (jabber-iq-query xml-data) 'digest) ;; SHA1 digest passwords allowed - (let ((passwd (jabber-read-passwd))) + (let ((passwd (jabber-read-password (jabber-connection-bare-jid jc)))) (if passwd (setq auth `(digest () ,(sha1 (concat session-id passwd)))))) ;; Plaintext passwords - allow on encrypted connections (if (or *jabber-encrypted* (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? ")) - (let ((passwd (jabber-read-passwd))) + (let ((passwd (jabber-read-password (jabber-connection-bare-jid jc)))) (when passwd (setq auth `(password () ,passwd)))))) |
From: Magnus H. <leg...@us...> - 2007-08-24 02:43:54
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv27257 Modified Files: jabber-core.el jabber-sasl.el NEWS jabber-util.el jabber-logon.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-393 Creator: Magnus Henoch <ma...@fr...> Implement password caching Index: NEWS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/NEWS,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- NEWS 24 Aug 2007 01:36:06 -0000 1.60 +++ NEWS 24 Aug 2007 02:43:50 -0000 1.61 @@ -2,14 +2,18 @@ * New features in jabber.el 0.8 +** Support for multiple accounts +(not documented yet) + +** Automatic reconnection +Not enabled by default; see jabber-auto-reconnect. +(not documented yet) + ** Support for XEP-0085 This means "contact is typing" notifications when chatting with Gajim or Google Talk users, among others. (not documented yet) -** Support for multiple accounts -(not documented yet) - ** Option: hide offline contacts in roster See jabber-show-offline-contacts. (not documented yet) Index: jabber-core.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- jabber-core.el 23 Aug 2007 20:44:10 -0000 1.60 +++ jabber-core.el 24 Aug 2007 02:43:50 -0000 1.61 @@ -93,7 +93,10 @@ :group 'jabber-core) (defcustom jabber-auto-reconnect nil - "Reconnect automatically after losing connection?" + "Reconnect automatically after losing connection? +This will be of limited use unless you have the password library +installed, and have configured it to cache your password +indefinitely. See `password-cache' and `password-cache-expiry'." :type 'boolean :group 'jabber-core) @@ -415,7 +418,8 @@ (:authentication-failure ;; jabber-logon has already displayed a message - (list nil state-data)))) + (list nil (plist-put state-data + :disconnection-expected t))))) (define-enter-state jabber-connection :sasl-auth (fsm state-data) @@ -455,7 +459,8 @@ (:authentication-failure ;; jabber-sasl has already displayed a message - (list nil state-data)))) + (list nil (plist-put state-data + :disconnection-expected t))))) (define-enter-state jabber-connection :bind (fsm state-data) Index: jabber-util.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-util.el,v retrieving revision 2.48 retrieving revision 2.49 diff -u -d -r2.48 -r2.49 --- jabber-util.el 15 Aug 2007 20:47:40 -0000 2.48 +++ jabber-util.el 24 Aug 2007 02:43:50 -0000 2.49 @@ -20,6 +20,9 @@ ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (eval-when-compile (require 'cl)) +(condition-case nil + (require 'password) + (error nil)) (defvar jabber-jid-history nil "History of entered JIDs") @@ -253,7 +256,11 @@ (format "(default %s) " node-at-point))) node-at-point))) -(defun jabber-read-passwd (&optional prompt) +(defun jabber-password-key (bare-jid) + "Construct key for `password' library from BARE-JID." + (concat "xmpp:" bare-jid)) + +(defun jabber-read-password (bare-jid &optional prompt) "Read Jabber password, either from customized variable or from minibuffer. See `jabber-password'." (if jabber-password @@ -261,7 +268,16 @@ ;; variable jabber-password is a high-convenience low-security ;; alternative anyway. (copy-sequence jabber-password) - (read-passwd (or prompt "Jabber password: ")))) + (let ((prompt (or prompt (format "Jabber password for %s: " bare-jid)))) + (if (fboundp 'password-read-and-add) + (password-read-and-add prompt (jabber-password-key bare-jid)) + (read-passwd prompt))))) + +(defun jabber-uncache-password (bare-jid) + "Uncache cached password for BARE-JID. +Useful if the password proved to be wrong." + (when (fboundp 'password-cache-remove) + (password-cache-remove (jabber-password-key bare-jid)))) (defun jabber-read-account (&optional always-ask) "Ask for which connected account to use. Index: jabber-logon.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-logon.el,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- jabber-logon.el 12 Feb 2007 20:51:53 -0000 1.12 +++ jabber-logon.el 24 Aug 2007 02:43:50 -0000 1.13 @@ -1,7 +1,7 @@ ;; jabber-logon.el - logon functions +;; Copyright (C) 2003, 2004, 2007 - Magnus Henoch - ma...@fr... ;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in... -;; Copyright (C) 2003, 2004 - Magnus Henoch - ma...@fr... ;; This file is a part of jabber.el. @@ -60,7 +60,7 @@ (resource () ,(plist-get (fsm-get-state-data jc) :resource))) #'jabber-process-logon t #'jabber-process-logon nil) - (jabber-disconnect-one jc)))) + (fsm-send jc :authentication-failure)))) (defun jabber-process-logon (jc xml-data closure-data) "receive login success or failure, and request roster. @@ -71,6 +71,7 @@ ;; Logon failure (jabber-report-success jc xml-data "Logon") + (jabber-uncache-password (jabber-connection-bare-jid jc)) (fsm-send jc :authentication-failure))) (provide 'jabber-logon) Index: jabber-sasl.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-sasl.el,v retrieving revision 2.9 retrieving revision 2.10 diff -u -d -r2.9 -r2.10 --- jabber-sasl.el 22 Apr 2007 10:26:42 -0000 2.9 +++ jabber-sasl.el 24 Aug 2007 02:43:50 -0000 2.10 @@ -57,31 +57,31 @@ (if node (fsm-send jc :use-legacy-auth-instead) (message "No suitable SASL mechanism found") - (fsm-send jc :authentication-failed))) + (fsm-send jc :authentication-failure))) ;; Watch for plaintext logins over unencrypted connections - (when (and (not *jabber-encrypted*) - (member (sasl-mechanism-name mechanism) - '("PLAIN" "LOGIN")) - (not (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? "))) - (error "Login cancelled")) + (if (and (not *jabber-encrypted*) + (member (sasl-mechanism-name mechanism) + '("PLAIN" "LOGIN")) + (not (yes-or-no-p "Jabber server only allows cleartext password transmission! Continue? "))) + (fsm-send jc :authentication-failure) - ;; Start authentication. - (let* ((client (sasl-make-client mechanism - (plist-get (fsm-get-state-data jc) :username) - "xmpp" - (plist-get (fsm-get-state-data jc) :server))) - (step (sasl-next-step client nil))) - (jabber-send-sexp - jc - `(auth ((xmlns . "urn:ietf:params:xml:ns:xmpp-sasl") - (mechanism . ,(sasl-mechanism-name mechanism))) - ,(when (sasl-step-data step) - (base64-encode-string (sasl-step-data step) t)))) - (cons client step))))) + ;; Start authentication. + (let* ((client (sasl-make-client mechanism + (plist-get (fsm-get-state-data jc) :username) + "xmpp" + (plist-get (fsm-get-state-data jc) :server))) + (step (sasl-next-step client nil))) + (jabber-send-sexp + jc + `(auth ((xmlns . "urn:ietf:params:xml:ns:xmpp-sasl") + (mechanism . ,(sasl-mechanism-name mechanism))) + ,(when (sasl-step-data step) + (base64-encode-string (sasl-step-data step) t)))) + (cons client step)))))) (defun jabber-sasl-process-input (jc xml-data sasl-data) - (let ((sasl-read-passphrase #'jabber-read-passwd) + (let ((sasl-read-passphrase #'jabber-read-password) (client (car sasl-data)) (step (cdr sasl-data))) (cond @@ -97,6 +97,7 @@ ((eq (car xml-data) 'failure) (message "SASL authentication failure: %s" (jabber-xml-node-name (car (jabber-xml-node-children xml-data)))) + (jabber-uncache-password (jabber-connection-bare-jid jc)) (fsm-send jc :authentication-failure)) ((eq (car xml-data) 'success) |
From: Magnus H. <leg...@us...> - 2007-08-24 01:36:12
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv1097 Modified Files: jabber.el jabber-chat.el AUTHORS jabber-muc.el NEWS Added Files: jabber-chatstates.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-392 Creator: Magnus Henoch <ma...@fr...> Support XEP-0085 Patch by Ami Fischman --- NEW FILE: jabber-chatstates.el --- ;;; jabber-chatstate.el --- Chat state notification (XEP-0085) implementation ;; Author: Ami Fischman <am...@fi...> ;; (based entirely on jabber-events.el by Magnus Henoch <ma...@fr...>) ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;; TODO ;; - Currently only active/composing notifications are /sent/ though all 5 ;; notifications are handled on receipt. (require 'cl) (defgroup jabber-chatstates nil "Chat state notifications." :group 'jabber) (defconst jabber-chatstates-xmlns "http://jabber.org/protocol/chatstates" "XML namespace for the chatstates feature.") ;;; INCOMING ;;; Code for requesting chat state notifications from others and handling ;;; them. (defvar jabber-chatstates-last-state nil "The last seen chat state.") (make-variable-buffer-local 'jabber-chatstates-last-state) (defvar jabber-chatstates-message "" "Human-readable presentation of chat state information") (make-variable-buffer-local 'jabber-chatstates-message) (defun jabber-chatstates-update-message () (setq jabber-chatstates-message (if (and jabber-chatstates-last-state (not (eq 'active jabber-chatstates-last-state))) (format " (%s)" (symbol-name jabber-chatstates-last-state)) ""))) (add-hook 'jabber-chat-send-hooks 'jabber-chatstates-when-sending) (defun jabber-chatstates-when-sending (text id) (jabber-chatstates-update-message) (jabber-chatstates-stop-timer) `((active ((xmlns . ,jabber-chatstates-xmlns))))) ;;; OUTGOING ;;; Code for handling requests for chat state notifications and providing ;;; them, modulo user preferences. (defcustom jabber-chatstates-confirm t "Send notifications about chat states?" :group 'jabber-chatstates :type 'boolean) (defvar jabber-chatstates-requested t "Whether or not chat states notification was requested") (make-variable-buffer-local 'jabber-chatstates-requested) (defvar jabber-chatstates-composing-sent nil "Has composing notification been sent? It can be sent and cancelled several times.") (make-variable-buffer-local 'jabber-chatstates-composing-sent) (defvar jabber-chatstates-paused-timer nil "Timer that counts down from 'composing state to 'paused.") (make-variable-buffer-local 'jabber-chatstates-paused-timer) (defun jabber-chatstates-stop-timer () "Stop the 'paused timer." (when jabber-chatstates-paused-timer (cancel-timer jabber-chatstates-paused-timer))) (defun jabber-chatstates-kick-timer () "Start (or restart) the 'paused timer as approriate." (jabber-chatstates-stop-timer) (setq jabber-chatstates-paused-timer (run-with-timer 5 nil 'jabber-chatstates-send-paused))) (defun jabber-chatstates-send-paused () "Send an 'paused state notification." (when jabber-chatting-with (setq jabber-chatstates-composing-sent nil) (jabber-send-sexp jabber-buffer-connection `(message ((to . ,jabber-chatting-with)) (paused ((xmlns . ,jabber-chatstates-xmlns))))))) (defun jabber-chatstates-after-change () (let* ((composing-now (not (= (point-max) jabber-point-insert))) (state (if composing-now 'composing 'active))) (when (and jabber-chatstates-confirm jabber-chatting-with (not (eq composing-now jabber-chatstates-composing-sent))) (jabber-send-sexp jabber-buffer-connection `(message ((to . ,jabber-chatting-with)) (,state ((xmlns . ,jabber-chatstates-xmlns))))) (when (setq jabber-chatstates-composing-sent composing-now) (jabber-chatstates-kick-timer))))) ;;; COMMON (defun jabber-handle-incoming-message-chatstates (jc xml-data) (when (get-buffer (jabber-chat-get-buffer (jabber-xml-get-attribute xml-data 'from))) (with-current-buffer (jabber-chat-get-buffer (jabber-xml-get-attribute xml-data 'from)) (cond ;; If we get an error message, we shouldn't report any ;; events, as the requests are mirrored from us. ((string= (jabber-xml-get-attribute xml-data 'type) "error") (remove-hook 'post-command-hook 'jabber-chatstates-after-change t) (setq jabber-chatstates-requested nil)) (t ;; Set up hooks for composition notification (when (and jabber-chatstates-confirm jabber-chatstates-requested) (add-hook 'post-command-hook 'jabber-chatstates-after-change nil t)) (setq jabber-chatstates-last-state (dolist (possible-node '(active composing paused inactive gone)) (let ((state (or (find jabber-chatstates-xmlns (jabber-xml-get-children xml-data possible-node) :key #'(lambda (x) (jabber-xml-get-attribute x 'xmlns)) :test #'string=) ;; XXX: this is how we interoperate with ;; Google Talk. We should really use a ;; namespace-aware XML parser. (find jabber-chatstates-xmlns (jabber-xml-get-children xml-data (intern (concat "cha:" (symbol-name possible-node)))) :key #'(lambda (x) (jabber-xml-get-attribute x 'xmlns:cha)) :test #'string=)))) (when state (setq jabber-chatstates-requested t) (return possible-node))))) (jabber-chatstates-update-message)))))) ;; Add function last in chain, so a chat buffer is already created. (add-to-list 'jabber-message-chain 'jabber-handle-incoming-message-chatstates t) (add-to-list 'jabber-advertised-features "http://jabber.org/protocol/chatstates") (provide 'jabber-chatstates) ;; arch-tag: d879de90-51e1-11dc-909d-000a95c2fcd0 Index: jabber-chat.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-chat.el,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- jabber-chat.el 7 Aug 2007 16:56:48 -0000 1.79 +++ jabber-chat.el 24 Aug 2007 01:36:06 -0000 1.80 @@ -54,7 +54,8 @@ (or (cdr (assoc (get buddy 'show) jabber-presence-faces)) 'jabber-roster-user-online)))) "\t" (:eval (jabber-fix-status (get (jabber-jid-symbol jabber-chatting-with) 'status))) - "\t" jabber-events-message) ;see jabber-events.el + "\t" jabber-events-message ;see jabber-events.el + "\t" jabber-chatstates-message) ;see jabber-chatstates.el "The specification for the header line of chat buffers. The format is that of `mode-line-format' and `header-line-format'." Index: jabber.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.el,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- jabber.el 7 May 2007 01:40:29 -0000 1.74 +++ jabber.el 24 Aug 2007 01:36:05 -0000 1.75 @@ -101,6 +101,7 @@ (require 'jabber-activity) (require 'jabber-vcard) (require 'jabber-events) +(require 'jabber-chatstates) (require 'jabber-vcard-avatars) (require 'jabber-autoaway) (require 'jabber-time) Index: jabber-muc.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-muc.el,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- jabber-muc.el 23 Aug 2007 21:08:09 -0000 1.70 +++ jabber-muc.el 24 Aug 2007 01:36:06 -0000 1.71 @@ -127,7 +127,8 @@ (defcustom jabber-muc-private-header-line-format '(" " (:eval (jabber-jid-resource jabber-chatting-with)) " in " (:eval (jabber-jid-displayname (jabber-jid-user jabber-chatting-with))) - "\t" jabber-events-message) + "\t" jabber-events-message + "\t" jabber-chatstates-message) "The specification for the header line of private MUC chat buffers. The format is that of `mode-line-format' and `header-line-format'." Index: AUTHORS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/AUTHORS,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- AUTHORS 19 Aug 2007 09:46:34 -0000 1.12 +++ AUTHORS 24 Aug 2007 01:36:06 -0000 1.13 @@ -7,6 +7,7 @@ Mathias Dahl Mario Domenech Goulart Nolan Eakins +Ami Fischman François Fleuret David Hansen Justin Kirby Index: NEWS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/NEWS,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- NEWS 31 Jul 2007 07:05:10 -0000 1.59 +++ NEWS 24 Aug 2007 01:36:06 -0000 1.60 @@ -2,6 +2,11 @@ * New features in jabber.el 0.8 +** Support for XEP-0085 +This means "contact is typing" notifications when chatting with Gajim +or Google Talk users, among others. +(not documented yet) + ** Support for multiple accounts (not documented yet) |