Commit b053ce26 authored by David Byers's avatar David Byers
Browse files

Fixed bug 975 (behavior of kom-send-letter)

Detailed changes:
> 	Fix bug 975:
> 	* commands1.el (lyskom-write-text): New function.
> 	(kom-write-text): Use it. Now letters and texts are the same.
> 	(kom-send-letter): Use it. Now letters and texts are the same.
>
parent 7b256d41
2003-03-16 David Byers <david.byers@swipnet.se>
Fix bug 975:
* commands1.el (lyskom-write-text): New function.
(kom-write-text): Use it. Now letters and texts are the same.
(kom-send-letter): Use it. Now letters and texts are the same.
Fix bug 250:
* lyskom-rest.el (lyskom-check-go-to-conf): Change priority when
accepting an invitation.
......
......@@ -496,41 +496,15 @@ as TYPE. If no such misc-info, return NIL"
(def-kom-command kom-send-letter (&optional pers-no)
"Send a personal letter to a person. This command is similar to
`kom-write-text', but intended specifically for sending personal
messages. When reading the recipient it will only allow letterboxes."
messages.
Several settings affect writing texts in general.
`kom-write-texts-in-window' controls which window is used to write the
comment; `kom-confirm-multiple-recipients' affects how multiple
recipients are handled."
(interactive)
(condition-case nil
(progn
(lyskom-tell-internat 'kom-tell-write-letter)
;; If there was a motd, which is now removed we have to
;; refetch the conf-stat to know that.
(let* ((tono (or pers-no
(lyskom-read-conf-no
(lyskom-get-string 'who-letter-to)
'(pers) nil nil t)))
(conf-stat (blocking-do 'get-conf-stat tono)))
(cache-del-conf-stat tono)
(if (if (zerop (conf-stat->msg-of-day conf-stat))
t
(progn
(recenter 1)
(lyskom-format-insert 'has-motd
conf-stat)
(lyskom-view-text (conf-stat->msg-of-day conf-stat))
(if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
t
nil)))
(if (= tono lyskom-pers-no)
(lyskom-edit-text lyskom-proc
(lyskom-create-misc-list 'RECPT tono)
"" "")
(lyskom-edit-text lyskom-proc
(if (lyskom-get-membership tono)
(lyskom-create-misc-list 'RECPT tono)
(lyskom-create-misc-list
'RECPT tono
'RECPT lyskom-pers-no))
"" "")))))
(quit (signal 'quit nil))))
(lyskom-tell-internat 'kom-tell-write-letter)
(lyskom-write-text pers-no 'who-letter-to nil))
;;; ================================================================
......@@ -632,9 +606,6 @@ the priority of several memberships, use `kom-prioritize' instead."
(lyskom-try-add-member conf-stat who pers-stat nil
'change-priority-for t)
conf-stat who))))))
;;; NOTE: This function is also called from lyskom-go-to-conf-handler
......@@ -1750,7 +1721,7 @@ If NO-PROMPT is non-nil, don't print message that we have gone to conf."
(lyskom-do-go-to-conf conf
(lyskom-get-membership
(conf-stat->conf-no conf) t))
(lyskom-insert-string 'nope))
(lyskom-report-command-answer nil))
(lyskom-insert-string 'no-ok))))))
;; DEBUG+++
......@@ -1836,31 +1807,43 @@ Several settings affect writing texts in general.
comment; `kom-confirm-multiple-recipients' affects how multiple
recipients are handled."
(interactive "P")
(let ((recpt (cond ((consp arg) lyskom-current-conf)
((numberp arg) arg)
(t (lyskom-read-conf-no
(lyskom-get-string 'who-send-text-to)
'(all)
nil
(if (zerop lyskom-current-conf)
nil
(cons (conf-stat->name
(blocking-do 'get-conf-stat
lyskom-current-conf))
0))
t)))))
(if (or (null recpt)
(zerop recpt))
(lyskom-insert-string 'no-in-conf)
(lyskom-tell-internat 'kom-tell-write-text)
(lyskom-edit-text lyskom-proc
(if (lyskom-get-membership recpt)
(lyskom-create-misc-list 'RECPT recpt)
(lyskom-create-misc-list
'RECPT recpt
'RECPT (or (lyskom-get-send-comments-to lyskom-pers-no)
lyskom-pers-no)))
"" ""))))
(lyskom-tell-internat 'kom-tell-write-text)
(lyskom-write-text arg 'who-send-text-to lyskom-current-conf))
(defun lyskom-write-text (arg prompt default)
"Start writing a new text."
(when default
(setq default (uconf-stat->name (blocking-do 'get-uconf-stat default))))
(let* ((tono (or arg
(lyskom-read-conf-no
(lyskom-get-string prompt)
'(pers conf)
nil
(and default (cons default 0))
t)))
(conf-stat (blocking-do 'get-conf-stat tono)))
(cache-del-conf-stat tono)
(if (if (zerop (conf-stat->msg-of-day conf-stat))
t
(progn
(recenter 1)
(lyskom-format-insert 'has-motd
conf-stat)
(lyskom-view-text (conf-stat->msg-of-day conf-stat))
(if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
t
nil)))
(if (= tono lyskom-pers-no)
(lyskom-edit-text lyskom-proc
(lyskom-create-misc-list 'RECPT tono)
"" "")
(lyskom-edit-text lyskom-proc
(if (lyskom-get-membership tono)
(lyskom-create-misc-list 'RECPT tono)
(lyskom-create-misc-list
'RECPT tono
'RECPT lyskom-pers-no))
"" "")))))
;;; ================================================================
......
......@@ -279,7 +279,7 @@ f
(who-letter-to . "Vem vill du skicka brev till? ")
(who-send-text-to . "Vart vill du skicka inlgget? ")
(has-motd . "%#1P har en lapp p drren:\n\n")
(motd-persist-q . "Vill du fortfarande skicka brevet? ")
(motd-persist-q . "Vill du fortfarande skriva texten? ")
(who-to-add . "Vem vill du addera? ")
(where-to-add . "Vilket mte skall han/hon adderas till? ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment