From 430375b825b385b3489d 70e88f0270250458e235 Mon Sep 17 00 00 00 200

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 430375b825b385b3489d70e88f0270250458e235 Mon Sep 17 00:00:00 2001
From: Alexander Solovyov <piranha@piranha.org.ua>
Date: Sun, 16 Nov 2008 12:12:43 +0200
Subject: [PATCH] preserve current status when switching between them
---
jabber-presence.el | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/jabber-presence.el b/jabber-presence.el
index fe94924..1bbb90d 100644
--- a/jabber-presence.el
+++ b/jabber-presence.el
@@ -395,15 +395,15 @@ With prefix argument, ask for status message."
(interactive (list
(when current-prefix-arg
(jabber-read-with-input-method "status message: " *jabber-current-status* '*jabber-status-history*))))
- (jabber-send-presence "away" status *jabber-current-priority*))
+ (jabber-send-presence "away" (if status status *jabber-current-status*) *jabber-current-priority*))
(defun jabber-send-xa-presence (&optional status)
"Send extended away presence.
With prefix argument, ask for status message."
(interactive (list
- (when current-prefix-arg
- (jabber-read-with-input-method "status message: " *jabber-current-status* '*jabber-status-history*))))
- (jabber-send-presence "xa" status *jabber-current-priority*))
+ (when current-prefix-arg
+ (jabber-read-with-input-method "status message: " *jabber-current-status* '*jabber-status-history*))))
+ (jabber-send-presence "xa" (if status status *jabber-current-status*) *jabber-current-priority*))
;;;###autoload
(defun jabber-send-default-presence (&optional jc)
@@ -413,7 +413,10 @@ and `jabber-default-status'."
(interactive)
;; jc is ignored. It's only there so this function can be in
;; jabber-post-connect-hooks.
- (jabber-send-presence jabber-default-show jabber-default-status jabber-default-priority))
+ (jabber-send-presence
+ jabber-default-show
+ (if (not (string= jabber-default-status "")) jabber-default-status *jabber-current-status*)
+ jabber-default-priority))
(defun jabber-send-current-presence (&optional jc)
"(Re-)send current presence.
--
1.5.5.1