From fe11c4b1a7a8d6aec61db37063071e73212b44cd Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 2 Dec 2020 14:28:00 -0600 Subject: [PATCH] Fix: Only show tip on initial sync --- ement-structs.el | 3 ++- ement.el | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ement-structs.el b/ement-structs.el index 4b9295a..b2c543c 100644 --- a/ement-structs.el +++ b/ement-structs.el @@ -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 diff --git a/ement.el b/ement.el index 19f15fd..278e7b8 100644 --- a/ement.el +++ b/ement.el @@ -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."