Fix: Only show tip on initial sync

This commit is contained in:
Adam Porter 2020-12-02 14:28:00 -06:00
parent 210543b9bd
commit fe11c4b1a7
2 changed files with 7 additions and 2 deletions

View file

@ -46,7 +46,8 @@
hostname port)
(cl-defstruct ement-session
user server token transaction-id rooms next-batch device-id initial-device-display-name)
user server token transaction-id rooms next-batch
device-id initial-device-display-name has-synced-p)
(cl-defstruct ement-room
id display-name prev-batch

View file

@ -259,7 +259,11 @@ Runs `ement-sync-callback-hook' with SESSION."
(mapc (apply-partially #'ement--push-joined-room-events session) joined-rooms)
(setf (ement-session-next-batch session) next-batch)
(run-hook-with-args 'ement-sync-callback-hook session)
(message "Ement: Sync done. Use command `ement-view-room' to view a room.")))
(message (concat "Ement: Sync done."
(unless (ement-session-has-synced-p session)
;; Show tip after initial sync.
(setf (ement-session-has-synced-p session) t)
" Use command `ement-view-room' to view a room.")))))
(defun ement--auto-sync (session)
"If `ement-auto-sync' is non-nil, sync SESSION again."