mirror of
https://github.com/vale981/ement.el
synced 2025-03-05 09:21:37 -05:00
Tidy: (ement-room--handle-events) Rename function
Since it uses event "handlers," we might as well call it "handle."
This commit is contained in:
parent
3764439ccf
commit
081502116e
2 changed files with 6 additions and 6 deletions
|
@ -913,7 +913,7 @@ Interactively, send reaction to event at point."
|
|||
(with-current-buffer buffer
|
||||
;; FIXME: Unify insert/process-events.
|
||||
(ement-room--insert-events chunk 'retro)
|
||||
(ement-room--process-events chunk)
|
||||
(ement-room--handle-events chunk)
|
||||
(setf (ement-room-prev-batch room) end
|
||||
ement-room-retro-loading nil))))
|
||||
(message "Ement: Loaded %s earlier events." num-events)))
|
||||
|
@ -1092,10 +1092,10 @@ data slot."
|
|||
(setf (alist-get 'new-events (ement-room-local room)) nil)
|
||||
;; We don't use `ement-room--insert-events' to avoid extra
|
||||
;; calls to `ement-room--insert-ts-headers'.
|
||||
(ement-room--process-events (ement-room-state room))
|
||||
(ement-room--handle-events (ement-room-state room))
|
||||
;; TODO: Move event insertion to defevent handlers.
|
||||
(mapc #'ement-room--insert-event (ement-room-timeline room))
|
||||
(ement-room--process-events (ement-room-timeline room))
|
||||
(ement-room--handle-events (ement-room-timeline room))
|
||||
(ement-room--insert-ts-headers))
|
||||
;; Return the buffer!
|
||||
new-buffer)))
|
||||
|
@ -1270,7 +1270,7 @@ function to `ement-room-event-fns', which see."
|
|||
(ement-room--insert-event event)
|
||||
(ewoc-set-hf ement-ewoc "" footer)))
|
||||
|
||||
(defun ement-room--process-events (events)
|
||||
(defun ement-room--handle-events (events)
|
||||
"Process EVENTS in current buffer.
|
||||
Uses handlers defined in `ement-room-event-fns'. The current
|
||||
buffer should be a room's buffer."
|
||||
|
|
4
ement.el
4
ement.el
|
@ -434,7 +434,7 @@ To be called in `ement-sync-callback-hook'."
|
|||
(with-current-buffer buffer
|
||||
(cl-assert ement-room)
|
||||
(when (ement-room-ephemeral ement-room)
|
||||
(ement-room--process-events (ement-room-ephemeral ement-room))
|
||||
(ement-room--handle-events (ement-room-ephemeral ement-room))
|
||||
(setf (ement-room-ephemeral ement-room) nil))
|
||||
(when-let ((new-events (alist-get 'new-events (ement-room-local ement-room))))
|
||||
(ement-room--insert-events new-events)
|
||||
|
@ -442,7 +442,7 @@ To be called in `ement-sync-callback-hook'."
|
|||
;; FIXME: Unify this.
|
||||
;; HACK: Process these events in reverse order, so that later events (like reactions)
|
||||
;; which refer to earlier events can find them. (Not sure if still necessary.)
|
||||
(ement-room--process-events (reverse new-events))
|
||||
(ement-room--handle-events (reverse new-events))
|
||||
;; Clear new events slot.
|
||||
(setf (alist-get 'new-events (ement-room-local ement-room)) nil))))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue