1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-25 00:00:54 +01:00

- added user mention on top of a reply message.

This commit is contained in:
cage 2020-05-15 17:39:23 +02:00
parent 6adf19fa38
commit 11bdf47b6c
3 changed files with 18 additions and 6 deletions

View File

@ -1117,6 +1117,15 @@ identifier despite the name."
(from :status)
(where (:= :status-id status-id)))))
(defun find-message-id (status-id)
"Find a message (status with other columns like acct) by id, notes
that status id is not a unique identifier despite the name."
(fetch-single (make-filtered-message-select nil
nil
nil
nil
`(:= :status-id ,status-id))))
(defun find-status-id-folder-timeline (status-id folder timeline)
"Fetch a single message identified by `status-id', `folder' and `timeline'.

View File

@ -745,6 +745,7 @@
:message-from-timeline-folder-message-index
:message-index->tree
:find-status-id
:find-message-id
:data-id
:row-id
:row-message-visibility

View File

@ -753,16 +753,18 @@ Starting from the oldest toot and going back."
;; timeline here as the id in unique identifier for a
;; single message *content* regardless of the position
;; in db (folder, timeline).
(when-let* ((message (db:find-status-id reply-id))
(quoted-text (db:row-message-rendered-text message))
(lines (split-lines quoted-text))
(quote-mark (swconf:quote-char))
(quoted-lines (mapcar (lambda (a) (strcat quote-mark a))
lines)))
(when-let* ((message (db:find-message-id reply-id))
(reply-username (db:row-message-username message))
(quoted-text (db:row-message-rendered-text message))
(lines (split-lines quoted-text))
(quote-mark (swconf:quote-char))
(quoted-lines (mapcar (lambda (a) (strcat quote-mark a))
lines)))
(with-open-file (stream file
:if-exists :append
:direction :output
:element-type 'character)
(format stream "~a~%" (msg-utils:add-mention-prefix reply-username))
(loop for line in quoted-lines do
(format stream "~a~%" line))))))
(add-body ()