Change: (ement-notify) Only run when session hasn't synced yet

This commit is contained in:
Adam Porter 2021-07-29 02:01:25 -05:00
parent df5c3fe170
commit 62302949df

View file

@ -86,8 +86,10 @@ the session (each the respective struct)."
(defun ement-notify (event room session) (defun ement-notify (event room session)
"Send notifications for EVENT in ROOM on SESSION. "Send notifications for EVENT in ROOM on SESSION.
Calls functions in `ement-notify-functions' if any of Calls functions in `ement-notify-functions' if any of
`ement-notify-predicates' return non-nil." `ement-notify-predicates' return non-nil. Does not do anything
(when (and (cl-loop for pred in ement-notify-predicates if session hasn't finished initial sync."
(when (and (ement-session-has-synced-p session)
(cl-loop for pred in ement-notify-predicates
thereis (funcall pred event room session)) thereis (funcall pred event room session))
(cl-loop for pred in ement-notify-functions (cl-loop for pred in ement-notify-functions
always (funcall pred event room session))) always (funcall pred event room session)))