1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-02 01:06:40 +01:00

- [fediverse] ensured, when opening a post that boosted a poll, that the reblogged poll's text is rendered.

This commit is contained in:
cage 2024-10-22 20:54:05 +02:00
parent efed27fc64
commit 2eed0f6659
2 changed files with 20 additions and 14 deletions

View File

@ -1477,7 +1477,9 @@ than (swconf:config-purge-history-days-offset) days in the past"
(hooks:run-hook-compose 'hooks:*after-saving-message* db-status)))
;; add poll or update poll's votes
(when poll
(update-db poll :status-id id)))))))
(if reblog-id
(update-db poll :status-id reblog-id)
(update-db poll :status-id id))))))))
(defun find-chat (chat-id)
(fetch-single (select :*

View File

@ -860,7 +860,7 @@ db:renumber-timeline-message-index."
(reblogged-status (db:find-status-id reblogged-id)))
(let ((body (db:row-message-rendered-text reblogged-status))
(attachments (status-attachments->text reblogged-id)))
(values body attachments))))
(values body attachments reblogged-id))))
(defun maybe-remove-mentions (window status-id)
(a:when-let ((exists-mention-p (db:single-status-exists-p status-id
@ -909,19 +909,23 @@ db:renumber-timeline-message-index."
(header (message-original->text-header fields)))
(let* ((body (db:row-message-rendered-text fields))
(attachments (status-attachments->text status-id))
(refresh-event (make-instance 'program-events:refresh-conversations-window-event))
(poll (db:find-poll-bound-to-status status-id))
(poll-text (poll->text (db:row-id poll)
(truncate (/ (win-width-no-border object)
2)))))
(multiple-value-bind (reblogged-status-body reblogged-status-attachments)
(refresh-event (make-instance 'program-events:refresh-conversations-window-event)))
(multiple-value-bind (reblogged-status-body
reblogged-status-attachments
reblogged-id)
(reblogged-data fields)
(let ((actual-body (if (string= body reblogged-status-body)
body
(strcat body reblogged-status-body)))
(actual-attachments (if (string= attachments reblogged-status-attachments)
attachments
(strcat reblogged-status-attachments attachments))))
(let* ((status-id-for-poll (or reblogged-id
status-id))
(poll (db:find-poll-bound-to-status status-id-for-poll))
(poll-text (poll->text (db:row-id poll)
(truncate (/ (win-width-no-border object)
2))))
(actual-body (if (string= body reblogged-status-body)
body
(strcat body reblogged-status-body)))
(actual-attachments (if (string= attachments reblogged-status-attachments)
attachments
(strcat reblogged-status-attachments attachments))))
(maybe-remove-mentions object status-id)
(maybe-initialize-metadata *message-window*)
(set-status-tuple-shown-status *message-window*