1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-01-31 04:24:48 +01:00

- added feature to allow users ro configure symbols rendered for each toot visibility level in main window.

This commit is contained in:
cage 2021-01-24 16:15:42 +01:00
parent c75efe0638
commit 1710ac5b48
4 changed files with 51 additions and 2 deletions

View File

@ -432,7 +432,18 @@ message-window.account.unlocked.mark.value = " 🔓"
# the string for the header of attachments in a message, if not
# specified a default is chosen by the software.
#message-window.attachment-header.value = " attachment "
# message-window.attachment-header.value = " attachment "
# below the text printed for toot's visibility level: public,
# unlisted, private or direct
message-window.visibility.public = "🌐"
message-window.visibility.unlisted = "🔓"
message-window.visibility.private = "🔒"
message-window.visibility.direct = "📧"
# this is the window that allow to browse the attachments of a message

View File

@ -223,12 +223,19 @@
as-text))
as-text)))
(defun visibility->mark (visibility)
(let ((mapping (swconf:message-windows-visibility-marks)))
(db-getf mapping
(make-keyword (string-upcase visibility))
:default visibility
:only-empty-or-0-are-null t)))
(defun message-original->text-header (message-row)
(let* ((date-format (swconf:date-fmt swconf:+key-message-window+))
(username (db:row-message-username message-row))
(display-name (db:row-message-user-display-name message-row))
(creation-time (db:row-message-creation-time message-row))
(visibility (db:row-message-visibility message-row))
(visibility (visibility->mark (db:row-message-visibility message-row)))
(lockedp (db-utils:db-not-nil-p (db:row-lockedp message-row)))
(locked-mark (swconf:message-window-account-locking-status-mark lockedp))
(encoded-date (db-utils:encode-datetime-string creation-time))

View File

@ -1125,6 +1125,7 @@
:message-window-unlocked-account-mark
:message-window-account-locking-status-mark
:message-window-line-mark-values
:message-windows-visibility-marks
:message-window-attachments-header
:form-style
:background

View File

@ -340,6 +340,11 @@
link
creation-time
access-time
visibility
public
unlisted
private
direct
quote
h1
h2
@ -956,6 +961,31 @@
+key-line-position-mark+
+key-background+)))
(defun message-window-visibility-mark (visibility-level)
(access:accesses *software-configuration*
+key-message-window+
+key-visibility+
visibility-level))
(defmacro gen-visibility-mapping-marks (visibility-level)
`(defun ,(format-fn-symbol t "message-window-visibility-~a-mark" visibility-level) ()
(message-window-visibility-mark ,visibility-level)))
(gen-visibility-mapping-marks "public")
(gen-visibility-mapping-marks "unlisted")
(gen-visibility-mapping-marks "private")
(gen-visibility-mapping-marks "direct")
(defun message-windows-visibility-marks ()
(list :public (message-window-visibility-public-mark)
:unlisted (message-window-visibility-unlisted-mark)
:private (message-window-visibility-private-mark)
:direct (message-window-visibility-direct-mark)))
(defun message-window-attachments-header ()
(values (access:accesses *software-configuration*
+key-message-window+