JasmineCorp Directory   
  
Usenet News Group Archives!!!

Usenet Groups:

 

 

 

 

 

emacs-jabber jabber-core.el,1.74,1.75 jabber-presence.el,1.40,1.41
--------------------------------------------------------------------------------------------
Newsgroup: gmane.emacs.jabber.scm
Posted by: Magnus Henoch
2008-01-13 18:05:23

Update of /cvsroot/emacs-jabber/emacs-jabber
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22357

Modified Files:
jabber-core.el jabber-presence.el
Log Message:
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-433
Creator: Magnus Henoch

Add `jabber-send-sexp-if-connected' and use it in `jabber-send-presence'


Index: jabber-core.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-core.el,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- jabber-core.el 25 Dec 2007 14:42:10 -0000 1.74
+++ jabber-core.el 13 Jan 2008 18:05:20 -0000 1.75
@@ -1,6 +1,6 @@
;; jabber-core.el - core functions

-;; 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-Connection Parts:
@@ -674,6 +674,13 @@
(jabber-process-input fsm (cadr event))
(list :session-established state-data))))

+ (:send-if-connected
+ ;; This is the only state in which we respond to such messages.
+ ;; This is to make sure we don't send anything inappropriate
+ ;; during authentication etc.
+ (jabber-send-sexp fsm (cdr event))
+ (list :session-established state-data))
+
(:do-disconnect
(jabber-send-string fsm "")
(list nil (plist-put state-data
@@ -917,6 +924,10 @@
(sit-for 2)))
(jabber-send-string jc (jabber-sexp2xml sexp)))

+(defun jabber-send-sexp-if-connected (jc sexp)
+ "Send the stanza SEXP only if JC has established a session."
+ (fsm-send-sync jc (cons :send-if-connected sexp)))
+
(defun jabber-send-stream-header (jc)
"Send stream header to connection JC."
(let ((stream-header

Index: jabber-presence.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-presence.el,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- jabber-presence.el 28 Dec 2007 22:39:04 -0000 1.40
+++ jabber-presence.el 13 Jan 2008 18:05:21 -0000 1.41
@@ -1,6 +1,6 @@
;; jabber-presence.el - roster and presence bookkeeping

-;; 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

;; This file is a part of jabber.el.
@@ -304,7 +304,7 @@
(dolist (jc jabber-connections)
(let ((subelements (jabber-presence-children jc)))
(aput 'subelements-map jc subelements)
- (jabber-send-sexp jc `(presence () ,@subelements))))
+ (jabber-send-sexp-if-connected jc `(presence () ,@subelements))))
;; Then send presence to groupchats
(dolist (groupchat *jabber-active-groupchats*)
(let* ((buffer (get-buffer (jabber-muc-get-buffer (car groupchat))))
@@ -312,7 +312,7 @@
(buffer-local-value 'jabber-buffer-connection buffer)))
(subelements (cdr (assq jc subelements-map))))
(when jc
- (jabber-send-sexp jc `(presence ((to . ,(car groupchat))) ,@subelements))))))
+ (jabber-send-sexp-if-connected jc `(presence ((to . ,(car groupchat))) ,@subelements))))))
(jabber-display-roster))

(defun jabber-presence-children (jc)


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

 

 

 

More >> 

Domain Registration:
.com .org .net
.info .biz .us