Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse fractional second #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions jabber-muc.el
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,14 @@ Return nil if X-MUC is nil."
;; case we don't want an alert.
(let ((children-namespaces (mapcar (lambda (x) (when (listp x) (jabber-xml-get-attribute x 'xmlns)))
(jabber-xml-node-children xml-data))))
(unless (or (member "urn:xmpp:delay" children-namespaces)
(member "jabber:x:delay" children-namespaces))
;; MR: Commented as mam is adding delay, so we cannot rely purely on that to detect history
;; (unless (or (member "urn:xmpp:delay" children-namespaces)
;; (member "jabber:x:delay" children-namespaces))
(dolist (hook '(jabber-muc-hooks jabber-alert-muc-hooks))
(run-hook-with-args hook
nick group (current-buffer) body-text
(funcall jabber-alert-muc-function
nick group (current-buffer) body-text))))))))))
nick group (current-buffer) body-text)))))))))

(defun jabber-muc-process-presence (jc presence)
(let* ((from (jabber-xml-get-attribute presence 'from))
Expand Down
9 changes: 7 additions & 2 deletions jabber-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

(require 's)

(eval-when-compile (require 'cl))
(condition-case nil
(require 'password)
Expand Down Expand Up @@ -484,8 +486,11 @@ TIME is in a format accepted by `format-time-string'."
;; fractions are optional
(fraction (if (eq (aref time 19) ?.)
(string-to-number (substring time 20 23))))
(timezone (substring time (if fraction 23 19))))
;; timezone is either Z (UTC) or [+-]HH:MM
(timezone (if (> (length time) 17)
(if (setq tz (car (cdr (s-slice-at "[Z+-]" (substring "2015-02-07T15:56:17.12Z" 19)))))
tz
"Z")
"Z")))
(let ((timezone-seconds
(if (string= timezone "Z")
0
Expand Down
Loading