mirror of https://codeberg.org/cage/tinmop/
- prevented deletion of mentions when the program is in debug-mode;
- [gemini] prevented crash when and error getting data from TLS socket; - prevented crash when dumping mentions.
This commit is contained in:
parent
41a4787f16
commit
66c7adab15
|
@ -756,6 +756,7 @@ the latest 15 mentions)."
|
|||
mentions-so-far))
|
||||
|
||||
(defun update-mentions-folder (&key (delete-mentions-on-server t))
|
||||
(declare (ignorable delete-mentions-on-server)) ; because of the render macro '#-debug-mode'
|
||||
(let ((trees '()))
|
||||
(when-let* ((all-mentions (all-mentions))
|
||||
(statuses (loop for mention in all-mentions
|
||||
|
@ -773,6 +774,7 @@ the latest 15 mentions)."
|
|||
:folder db:+mentions-status-folder+
|
||||
:localp t
|
||||
:min-id nil)))
|
||||
#-debug-mode
|
||||
(when delete-mentions-on-server
|
||||
(loop for mention in all-mentions do
|
||||
(delete-notification (tooter:id mention))))
|
||||
|
|
|
@ -429,7 +429,8 @@
|
|||
(loop
|
||||
named download-loop
|
||||
for ct from 0
|
||||
for line-as-array = (read-line-into-array download-stream)
|
||||
for line-as-array = (with-print-error-message
|
||||
(read-line-into-array download-stream))
|
||||
while line-as-array do
|
||||
(gemini-client:debug-gemini "[stream] gemini file stream raw data line : ~a"
|
||||
line-as-array)
|
||||
|
@ -494,7 +495,8 @@
|
|||
(with-open-support-file (file-stream support-file)
|
||||
(let ((partial-content-not-opened t))
|
||||
(labels ((download-completed-p (buffer read-so-far)
|
||||
(< read-so-far (length buffer)))
|
||||
(and buffer
|
||||
(< read-so-far (length buffer))))
|
||||
(opening-partial-contents-p (read-so-far)
|
||||
(let ((buffer-size (swconf:link-regex->program-to-use-buffer-size path)))
|
||||
(if buffer-size
|
||||
|
@ -507,7 +509,8 @@
|
|||
(swconf:link-regex->program-to-use support-file)
|
||||
(declare (ignore y))
|
||||
(multiple-value-bind (buffer read-so-far)
|
||||
(read-array download-stream +read-buffer-size+)
|
||||
(with-print-error-message
|
||||
(read-array download-stream +read-buffer-size+))
|
||||
(declare ((vector (unsigned-byte 8)) buffer))
|
||||
(declare (fixnum read-so-far))
|
||||
(increment-bytes-count wrapper-object read-so-far)
|
||||
|
|
|
@ -1690,9 +1690,11 @@
|
|||
(message-window specials:*message-window*))
|
||||
(if mentions
|
||||
(labels ((print-mention (notification)
|
||||
(format nil "type: ~a from ~a"
|
||||
(let ((raw-text (format nil
|
||||
"type: ~a from ~a"
|
||||
(tooter:kind notification)
|
||||
(tooter:account-name (tooter:account notification))))
|
||||
(tooter:account-name (tooter:account notification)))))
|
||||
(tui:make-tui-string raw-text)))
|
||||
(make-rows (mentions)
|
||||
(mapcar (lambda (mention)
|
||||
(make-instance 'line-oriented-window:line
|
||||
|
|
|
@ -508,7 +508,8 @@ latter has a length equals to `total-size'"))
|
|||
(error (e)
|
||||
(ui:notify (format nil (_ "Error: ~a") e)
|
||||
:life (* (swconf:config-notification-life) 5)
|
||||
:as-error t))))
|
||||
:as-error t)
|
||||
nil)))
|
||||
|
||||
(defmacro with-print-error-message (&body body)
|
||||
#+debug-mode `(progn ,@body)
|
||||
|
@ -516,4 +517,5 @@ latter has a length equals to `total-size'"))
|
|||
(progn
|
||||
,@body)
|
||||
(error (e)
|
||||
(ui:error-message (format nil (_ "Error: ~a") e)))))
|
||||
(ui:error-message (format nil (_ "Error: ~a") e))
|
||||
nil)))
|
||||
|
|
Loading…
Reference in New Issue