mirror of
https://github.com/vale981/ement.el
synced 2025-03-04 17:01:39 -05:00
Fix/Tidy: (defevent "m.typing") Show ID if no displayname
Maybe someday we'll use /members to get the displayname.
This commit is contained in:
parent
d1764ccf7a
commit
2ce26f405a
1 changed files with 10 additions and 12 deletions
|
@ -724,18 +724,16 @@ function to `ement-room-event-fns', which see."
|
|||
(ement-room-defevent "m.typing"
|
||||
(pcase-let* (((cl-struct ement-event content) event)
|
||||
((map ('user_ids user-ids)) content)
|
||||
(footer (if (zerop (length user-ids))
|
||||
""
|
||||
(propertize
|
||||
(concat "Typing: "
|
||||
(string-join
|
||||
(cl-loop for id across user-ids
|
||||
for user = (gethash id ement-users)
|
||||
if user
|
||||
collect (ement-room--user-display-name user ement-room)
|
||||
else do (message "Ement: Typing event can't find user struct for ID: %s" id))
|
||||
", "))
|
||||
'face 'font-lock-comment-face))))
|
||||
(usernames) (footer))
|
||||
(if (zerop (length user-ids))
|
||||
(setf footer "")
|
||||
(setf usernames (cl-loop for id across user-ids
|
||||
for user = (gethash id ement-users)
|
||||
if user
|
||||
collect (ement-room--user-display-name user ement-room)
|
||||
else collect id)
|
||||
footer (propertize (concat "Typing: " (string-join usernames ", "))
|
||||
'face 'font-lock-comment-face)))
|
||||
(ewoc-set-hf ement-ewoc "" footer)))
|
||||
|
||||
(defun ement-room--process-events (events)
|
||||
|
|
Loading…
Add table
Reference in a new issue