mirror of
https://github.com/vale981/ement.el
synced 2025-03-06 01:31:41 -05:00
Add: (ement, ement-taxy) Unread notifications
This commit is contained in:
parent
5ee6539df2
commit
324b4c725e
2 changed files with 12 additions and 2 deletions
|
@ -204,6 +204,16 @@
|
||||||
(propertize formatted-ts 'face face))
|
(propertize formatted-ts 'face face))
|
||||||
"")))
|
"")))
|
||||||
|
|
||||||
|
(ement-taxy-define-column #("Unread" 0 6 (help-echo "Unread events (Notifications:Highlights")) (:align 'right)
|
||||||
|
(pcase-let* ((`[,(cl-struct ement-room unread-notifications) ,_session] item)
|
||||||
|
((map notification_count highlight_count) unread-notifications))
|
||||||
|
(if (or (not unread-notifications)
|
||||||
|
(and (equal 0 notification_count)
|
||||||
|
(equal 0 highlight_count)))
|
||||||
|
""
|
||||||
|
(format #("%s:%s" 0 5 (help-echo "Notifications:Highlights"))
|
||||||
|
notification_count highlight_count))))
|
||||||
|
|
||||||
(ement-taxy-define-column #("B" 0 1 (help-echo "Buffer exists for room")) ()
|
(ement-taxy-define-column #("B" 0 1 (help-echo "Buffer exists for room")) ()
|
||||||
(pcase-let ((`[,(cl-struct ement-room (local (map buffer))) ,_session] item))
|
(pcase-let ((`[,(cl-struct ement-room (local (map buffer))) ,_session] item))
|
||||||
(if buffer #("B" 0 1 (help-echo "Buffer exists for room")) " ")))
|
(if buffer #("B" 0 1 (help-echo "Buffer exists for room")) " ")))
|
||||||
|
|
4
ement.el
4
ement.el
|
@ -728,8 +728,8 @@ Also used for left rooms, in which case TYPE should be set to
|
||||||
('unread_notifications unread-notifications))
|
('unread_notifications unread-notifications))
|
||||||
event-types)
|
event-types)
|
||||||
(latest-timestamp))
|
(latest-timestamp))
|
||||||
(ignore unread-notifications)
|
(setf (ement-room-type room) type
|
||||||
(setf (ement-room-type room) type)
|
(ement-room-unread-notifications room) unread-notifications)
|
||||||
;; NOTE: The idea is that, assuming that events in the sync reponse are in
|
;; NOTE: The idea is that, assuming that events in the sync reponse are in
|
||||||
;; chronological order, we push them to the lists in the room slots in that order,
|
;; chronological order, we push them to the lists in the room slots in that order,
|
||||||
;; leaving the head of each list as the most recent event of that type. That means
|
;; leaving the head of each list as the most recent event of that type. That means
|
||||||
|
|
Loading…
Add table
Reference in a new issue