mirror of
https://github.com/vale981/ement.el
synced 2025-03-05 09:21:37 -05:00
Add: (ement--make-event) Record redactions
This commit is contained in:
parent
84739451af
commit
3064b07e0a
1 changed files with 7 additions and 2 deletions
9
ement.el
9
ement.el
|
@ -913,7 +913,7 @@ Also used for left rooms, in which case STATUS should be set to
|
|||
(defun ement--make-event (event)
|
||||
"Return `ement-event' struct for raw EVENT list.
|
||||
Adds sender to `ement-users' when necessary."
|
||||
(pcase-let* (((map content type unsigned
|
||||
(pcase-let* (((map content type unsigned redacts
|
||||
('event_id id) ('origin_server_ts ts)
|
||||
('sender sender-id) ('state_key state-key))
|
||||
event)
|
||||
|
@ -923,7 +923,12 @@ Adds sender to `ement-users' when necessary."
|
|||
ement-users))))
|
||||
;; MAYBE: Handle other keys in the event, such as "room_id" in "invite" events.
|
||||
(make-ement-event :id id :sender sender :type type :content content :state-key state-key
|
||||
:origin-server-ts ts :unsigned unsigned)))
|
||||
:origin-server-ts ts :unsigned unsigned
|
||||
;; Since very few events will be redactions and have this key, we
|
||||
;; record it in the local slot alist rather than as another slot on
|
||||
;; the struct.
|
||||
:local (when redacts
|
||||
(ement-alist 'redacts redacts)))))
|
||||
|
||||
(defun ement--put-event (event _room session)
|
||||
"Put EVENT on SESSION's events table."
|
||||
|
|
Loading…
Add table
Reference in a new issue