mirror of https://codeberg.org/cage/tinmop/
Compare commits
2 Commits
c75efe0638
...
c66a71881e
Author | SHA1 | Date |
---|---|---|
cage | c66a71881e | |
cage | 1710ac5b48 |
|
@ -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
|
||||
|
||||
|
@ -460,6 +471,8 @@ open-message-link-window.input.selected.foreground = #FFB200
|
|||
|
||||
# gemini browser
|
||||
|
||||
gemini.current.url.prefix = "🌍 "
|
||||
|
||||
gemini.link.scheme.gemini.prefix = "→ "
|
||||
|
||||
gemini.link.scheme.other.prefix = "➶ "
|
||||
|
|
|
@ -174,7 +174,9 @@ list af all possible candidtae for completion."
|
|||
(defun make-complete-gemini-iri-fn (prompt)
|
||||
(lambda (hint)
|
||||
(when-let ((matched (remove-if-not (starts-with-clsr hint)
|
||||
(funcall #'db:history-prompt->values prompt))))
|
||||
(remove-duplicates (funcall #'db:history-prompt->values
|
||||
prompt)
|
||||
:test #'string=))))
|
||||
(values matched (reduce-to-common-prefix matched)))))
|
||||
|
||||
(defun complete-chat-message (hint)
|
||||
|
|
20
src/db.lisp
20
src/db.lisp
|
@ -724,14 +724,24 @@ to the corresponding id in table +table-account+"
|
|||
(when-let ((user (user-id->user user-id)))
|
||||
(db-getf user :acct)))
|
||||
|
||||
(defun last-in-history (prompt)
|
||||
(let* ((query (select (:*
|
||||
(:as (fields (:max :id)) :max))
|
||||
(from :input-history)
|
||||
(where (:= :prompt prompt)))))
|
||||
(fetch-single query)))
|
||||
|
||||
(defun insert-in-history (prompt input)
|
||||
"insert an history entry with `prompt` and `input'"
|
||||
(when (string-not-empty-p input)
|
||||
(let* ((now (prepare-for-db (local-time-obj-now)))
|
||||
(insert-query (make-insert :input-history
|
||||
(:prompt :input :date-added)
|
||||
(prompt input now))))
|
||||
(query insert-query))))
|
||||
(let* ((last-inserted (last-in-history prompt)))
|
||||
(when (or (null last-inserted)
|
||||
(not (string= input (getf last-inserted :input))))
|
||||
(let* ((now (prepare-for-db (local-time-obj-now)))
|
||||
(insert-query (make-insert :input-history
|
||||
(:prompt :input :date-added)
|
||||
(prompt input now))))
|
||||
(query insert-query))))))
|
||||
|
||||
(defun next-in-history (min-id prompt)
|
||||
"Return the history entry with prompt `prompt` and id that is greater
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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+
|
||||
|
|
Loading…
Reference in New Issue