This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "emacs-jabber".
The branch, namespace-prefixes has been updated
via dc9fc0fa06ff8a18b5599572671ce598374aa83c (commit)
via 9c8bea1bd5d68b49bc4d4675911d6c7d7fd10b95 (commit)
from a1bdfc5bb1bf46dab30031ca774484630fa17feb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dc9fc0fa06ff8a18b5599572671ce598374aa83c
Author: Magnus Henoch <leg...@us...>
Date: Sun Oct 2 21:00:19 2011 +0100
Fix :get function for jabber-roster-default-group-name
diff --git a/jabber-roster.el b/jabber-roster.el
index d12c4ea..fdc6ff5 100644
--- a/jabber-roster.el
+++ b/jabber-roster.el
@@ -155,9 +155,10 @@ Trailing newlines are always removed, regardless of this variable."
:group 'jabber-roster
:type 'string
:get '(lambda (var)
- (if (stringp var)
- (set-text-properties 0 (length var) nil var)
- var))
+ (let ((val (symbol-value var)))
+ (if (stringp val)
+ (set-text-properties 0 (length val) nil val)
+ val)))
:set '(lambda (var val)
(if (stringp val)
(set-text-properties 0 (length val) nil val))
commit 9c8bea1bd5d68b49bc4d4675911d6c7d7fd10b95
Author: Magnus Henoch <leg...@us...>
Date: Sun Oct 2 19:28:21 2011 +0100
Use xml-parse-region to parse stream header
This lets us get rid of some ugly hacks, and will make it easier to
extract other attributes from the header.
diff --git a/jabber-core.el b/jabber-core.el
index b2a1fa5..21d0d96 100644
--- a/jabber-core.el
+++ b/jabber-core.el
@@ -854,30 +854,18 @@ DATA is any sexp."
(return (fsm-send fsm :stream-end)))
;; Stream header?
- (when (looking-at "<stream:stream[^>]*>")
- (let ((stream-header (match-string 0))
- (ending-at (match-end 0))
- session-id stream-version)
- ;; These regexps extract attribute values from the stream
- ;; header, taking into account that the quotes may be either
- ;; single or double quotes.
- (setq session-id
- (and (or (string-match "id='\\([^']+\\)'" stream-header)
- (string-match "id=\"\\([^\"]+\\)\"" stream-header))
- (jabber-unescape-xml (match-string 1 stream-header))))
- (setq stream-version
- (and (or
- (string-match "version='\\([0-9.]+\\)'" stream-header)
- (string-match "version=\"\\([0-9.]+\\)\"" stream-header))
- (match-string 1 stream-header)))
- (jabber-log-xml fsm "receive" stream-header)
+ (when (looking-at "<stream:stream[^>]*\\(>\\)")
+ ;; Let's pretend that the stream header is a closed tag,
+ ;; and parse it as such.
+ (replace-match "/>" t t nil 1)
+ (let* (;; Thus we need to add one to the index...
+ (ending-at (1+ (match-end 0)))
+ (stream-header (car (xml-parse-region (point-min) ending-at)))
+ (session-id (jabber-xml-get-attribute stream-header 'id))
+ (stream-version (jabber-xml-get-attribute stream-header 'version)))
- ;; If the server is XMPP compliant, i.e. there is a version attribute
- ;; and it's >= 1.0, there will be a stream:features tag shortly,
- ;; so just wait for that.
-
+ (jabber-log-xml fsm "receive" stream-header)
(fsm-send fsm (list :stream-start session-id stream-version))
-
(delete-region (point-min) ending-at)))
;; Normal tag
-----------------------------------------------------------------------
Summary of changes:
jabber-core.el | 32 ++++++++++----------------------
jabber-roster.el | 7 ++++---
2 files changed, 14 insertions(+), 25 deletions(-)
hooks/post-receive
--
emacs-jabber
|