Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-473

Creator:  Magnus Henoch <mange@freemail.hu>

Don't reset presence when new account connects

Connecting a new account used to call jabber-send-default-presence,
which resets any custom presence sent (including autoaway).  Now
jabber-send-current-presence is used instead.

Fixes bug #1870437.
This commit is contained in:
Magnus Henoch 2008-03-27 16:09:13 +00:00 committed by Kirill A. Korinskiy
parent 85a8eb884d
commit 58da186907
3 changed files with 16 additions and 5 deletions

View File

@ -66,7 +66,7 @@
(defgroup jabber-core nil "customize core functionality"
:group 'jabber)
(defcustom jabber-post-connect-hooks '(jabber-send-default-presence
(defcustom jabber-post-connect-hooks '(jabber-send-current-presence
jabber-muc-autojoin)
"*Hooks run after successful connection and authentication.
The functions should accept one argument, the connection object."

View File

@ -411,6 +411,17 @@ and `jabber-default-status'."
;; jabber-post-connect-hooks.
(jabber-send-presence jabber-default-show jabber-default-status jabber-default-priority))
(defun jabber-send-current-presence (&optional jc)
"(Re-)send current presence.
That is, if presence has already been sent, use current settings,
else send defaults (see `jabber-send-default-presence')."
(interactive)
;; jc is ignored. It's only there so this function can be in
;; jabber-post-connect-hooks.
(if *jabber-current-show*
(jabber-send-presence *jabber-current-show* *jabber-current-status* *jabber-current-priority*)
(jabber-send-default-presence)))
(add-to-list 'jabber-jid-roster-menu
(cons "Send subscription request" 'jabber-send-subscription-request))
(defun jabber-send-subscription-request (jc to &optional request)

View File

@ -1,6 +1,6 @@
;; jabber.el - a minimal jabber client
;; Copyright (C) 2003, 2004, 2007 - Magnus Henoch - mange@freemail.hu
;; Copyright (C) 2003, 2004, 2007, 2008 - Magnus Henoch - mange@freemail.hu
;; Copyright (C) 2002, 2003, 2004 - tom berger - object@intelectronica.net
;; SSL - Support, mostly inspired by Gnus
@ -182,13 +182,13 @@ CONT is called when the result is available, with JC and the
result as arguments."
nil)
(defvar *jabber-current-status* ""
(defvar *jabber-current-status* nil
"the users current presence staus")
(defvar *jabber-current-show* ""
(defvar *jabber-current-show* nil
"the users current presence show")
(defvar *jabber-current-priority* 10
(defvar *jabber-current-priority* nil
"the user's current priority")
(defvar *jabber-status-history* nil