mirror of https://codeberg.org/cage/tinmop/
- added support for signature.
This commit is contained in:
parent
fc43ffb423
commit
9229d4dd08
|
@ -81,7 +81,9 @@ color-regexp = "⯀" green bold
|
||||||
|
|
||||||
color-regexp = "The poll has expired" #ff00ff bold
|
color-regexp = "The poll has expired" #ff00ff bold
|
||||||
|
|
||||||
|
# the signature file path relative to $HOME
|
||||||
|
|
||||||
|
# signature-file = ".signature"
|
||||||
|
|
||||||
# you can filter off users using regexp
|
# you can filter off users using regexp
|
||||||
|
|
||||||
|
|
|
@ -274,3 +274,7 @@
|
||||||
(format stream "~%~a~%" (_ "A single choice allowed")))
|
(format stream "~%~a~%" (_ "A single choice allowed")))
|
||||||
(when expiredp
|
(when expiredp
|
||||||
(format stream "~%~a~%" (_ "The poll has expired"))))))))
|
(format stream "~%~a~%" (_ "The poll has expired"))))))))
|
||||||
|
|
||||||
|
(defun signature ()
|
||||||
|
(when-let ((signature-file (swconf:signature-file-path)))
|
||||||
|
(format nil "-- ~%~a" (fs:slurp-file signature-file))))
|
||||||
|
|
|
@ -949,6 +949,7 @@
|
||||||
:parse
|
:parse
|
||||||
:load-config-file
|
:load-config-file
|
||||||
:external-editor
|
:external-editor
|
||||||
|
:signature-file-path
|
||||||
:vote-vertical-bar
|
:vote-vertical-bar
|
||||||
:crypted-mark-value
|
:crypted-mark-value
|
||||||
:quick-help-header-colors
|
:quick-help-header-colors
|
||||||
|
@ -1612,7 +1613,8 @@
|
||||||
:status-attachments->text
|
:status-attachments->text
|
||||||
:message-original->text-body
|
:message-original->text-body
|
||||||
:message-original->text-header
|
:message-original->text-header
|
||||||
:poll->text))
|
:poll->text
|
||||||
|
:signature))
|
||||||
|
|
||||||
(defpackage :thread-window
|
(defpackage :thread-window
|
||||||
(:use
|
(:use
|
||||||
|
|
|
@ -351,6 +351,7 @@
|
||||||
locked
|
locked
|
||||||
unlocked
|
unlocked
|
||||||
account
|
account
|
||||||
|
signature-file
|
||||||
main-window
|
main-window
|
||||||
thread-window
|
thread-window
|
||||||
message-window
|
message-window
|
||||||
|
@ -430,8 +431,21 @@
|
||||||
|
|
||||||
(defparameter *allowed-attachment-type* '("unknown" "image" "gifv" "video" "audio"))
|
(defparameter *allowed-attachment-type* '("unknown" "image" "gifv" "video" "audio"))
|
||||||
|
|
||||||
|
(define-constant +default-signature-filename+ ".signature" :test #'string=)
|
||||||
|
|
||||||
;;;; interface
|
;;;; interface
|
||||||
|
|
||||||
|
(defun signature-file-path ()
|
||||||
|
"Returns the filepath of the signature file, the $HOME is prepended."
|
||||||
|
(let* ((signature-file (or (access:accesses *software-configuration*
|
||||||
|
+key-signature-file+)
|
||||||
|
+default-signature-filename+))
|
||||||
|
(signature-path (fs:cat-parent-dir (fs:home-dir)
|
||||||
|
signature-file)))
|
||||||
|
(if (fs:file-exists-p signature-path)
|
||||||
|
signature-path
|
||||||
|
nil)))
|
||||||
|
|
||||||
(defun vote-vertical-bar ()
|
(defun vote-vertical-bar ()
|
||||||
(or (access:accesses *software-configuration*
|
(or (access:accesses *software-configuration*
|
||||||
+key-vote-vertical-bar+)
|
+key-vote-vertical-bar+)
|
||||||
|
|
|
@ -836,7 +836,15 @@ Force the checking for new message in the thread the selected message belong."
|
||||||
(format stream "~a~%" line))))))
|
(format stream "~a~%" line))))))
|
||||||
(add-body ()
|
(add-body ()
|
||||||
(let ((temp-file (fs:temporary-file))
|
(let ((temp-file (fs:temporary-file))
|
||||||
(reference-open-file (get-universal-time)))
|
(signature (message-rendering-utils:signature)))
|
||||||
|
(when signature
|
||||||
|
(with-open-file (stream
|
||||||
|
temp-file
|
||||||
|
:direction :output
|
||||||
|
:element-type 'character
|
||||||
|
:if-exists :supersede)
|
||||||
|
(write-sequence signature stream)))
|
||||||
|
(let ((reference-open-file (get-universal-time)))
|
||||||
(prepare-reply-body temp-file)
|
(prepare-reply-body temp-file)
|
||||||
(croatoan:end-screen)
|
(croatoan:end-screen)
|
||||||
(os-utils:open-with-editor temp-file)
|
(os-utils:open-with-editor temp-file)
|
||||||
|
@ -846,7 +854,7 @@ Force the checking for new message in the thread the selected message belong."
|
||||||
reference-open-file))
|
reference-open-file))
|
||||||
(let ((body (fs:slurp-file temp-file)))
|
(let ((body (fs:slurp-file temp-file)))
|
||||||
(setf (sending-message:body *message-to-send*) body)
|
(setf (sending-message:body *message-to-send*) body)
|
||||||
(add-subject))))))
|
(add-subject)))))))
|
||||||
(add-body)))
|
(add-body)))
|
||||||
|
|
||||||
(defun reply-message ()
|
(defun reply-message ()
|
||||||
|
|
Loading…
Reference in New Issue