Commit 2d8b2e37 authored by Linus Tolke Y's avatar Linus Tolke Y
Browse files

Cleanup at the personal messages. The sent messages are shown.

parent fccf7a9a
Fri Jan 24 22:14:20 1992 Linus Tolke Y (linus at ruben)
* async.el (lyskom-handle-as-personal-message): New function.
(lyskom-show-personal-message, lyskom-insert-personal-message):
now uses the lyskom-handle-as-personal-message.
commands2.el (lyskom-send-message, lyskom-send-message-2): Now
prints the personal messages locally usin the
lyskom-handle-as-personal-message function.
* commands2.el, swedish-strings.el (lyskom-send-message,
lyskom-send-message-2): Nu f}r man ett meddelande i bufferten
som inneh}ller vad man s{nde och till vem.
* commands1.el (kom-unset-conf-motd, lyskom-unset-conf-motd)
swedish-strings.el: Default for remove note on the door is
yourself.
Wed Jan 22 00:22:02 1992 Inge Wallin (inge at lysator)
* clienttypes.el (read-list-enter-read-info): Rewritten it into an
......
......@@ -262,33 +262,19 @@ Args: SENDER: conf-stat for the person issuing the broadcast message or a
RECIPIENT: 0 if this message is for everybody, otherwise the pers-no
of the user.
MESSAGE: A string containing the message."
(cond
((eq kom-show-personal-messages-in-buffer t)
(lyskom-insert-personal-message sender recipient message
'lyskom-insert-before-prompt))
((null kom-show-personal-messages-in-buffer))
(t
(lyskom-save-excursion
(set-buffer (get-buffer-create kom-show-personal-messages-in-buffer))
(goto-char (point-max))
(lyskom-insert-personal-message sender recipient message 'insert))))
(lyskom-insert-personal-message sender recipient message)
(run-hooks 'lyskom-personal-message-hook))
(defun lyskom-insert-personal-message (sender recipient message
insert-function)
(defun lyskom-insert-personal-message (sender recipient message)
"Insert a personal message in the current buffer.
Arguments: SENDER RECIPIENT MESSAGE INSERT-FUNCTION.
Arguments: SENDER RECIPIENT MESSAGE.
SENDER is a pers-stat (possibly nil) or a string.
RECIPIENT is 0 if the message is public, otherwise the pers-no of the user.
MESSAGE is a string containing the message.
INSERT-FUNCTION is a function that given a string inserts it into the
current buffer."
(funcall
insert-function
"\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n")
(funcall
insert-function
(lyskom-handle-as-personal-message
(if (= recipient 0)
(lyskom-format 'message-broadcast
(cond
......@@ -298,19 +284,35 @@ current buffer."
message
(substring (current-time-string) 11 19))
(lyskom-format 'message-from
(cond
((stringp sender) sender)
(sender (conf-stat->name sender))
(t (lyskom-get-string 'unknown)))
message
(substring (current-time-string) 11 19))))
(funcall insert-function
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n")
(if kom-pop-personal-messages
(display-buffer (current-buffer)))
(cond
((stringp sender) sender)
(sender (conf-stat->name sender))
(t (lyskom-get-string 'unknown)))
message
(substring (current-time-string) 11 19)))))
(defun lyskom-handle-as-personal-message (string)
"Insert STRING as a personal message.
The buffer, is chosen according to the kom-show-personal-messages-in-buffer
variable value.
The text is converted, before insertion."
(lyskom-save-excursion
(cond
((eq kom-show-personal-messages-in-buffer t)
(lyskom-insert-before-prompt string))
((null kom-show-personal-messages-in-buffer))
(t
(set-buffer (get-buffer-create kom-show-personal-messages-in-buffer))
(goto-char (point-max))
(insert (if kom-emacs-knows-iso-8859-1
string
(iso-8859-1-to-swascii string)))))
(if kom-pop-personal-messages
(display-buffer (current-buffer))))
(if kom-ding-on-personal-messages
(beep)))
;;; ================================================================
;;; Functions for dealing with a new text
......
......@@ -488,17 +488,23 @@ Args: MEMBERSHIP-LIST CONF-STAT."
(defun lyskom-send-message (pers-no)
"Send a message to the person with the number CONF-NO. CONF-NO == 0
means send the message to everybody."
(initiate-send-message 'main 'lyskom-send-message-2
pers-no
(lyskom-read-string (lyskom-get-string 'message-prompt))))
(let ((string (lyskom-read-string (lyskom-get-string 'message-prompt))))
(lyskom-collect 'main)
(initiate-send-message 'main nil pers-no string)
(initiate-get-conf-stat 'main nil pers-no)
(lyskom-use 'main 'lyskom-send-message-2 string)))
(defun lyskom-send-message-2 (reply)
(defun lyskom-send-message-2 (reply to-conf-stat string)
"Receive the reply from send-message and report on it."
(if reply
(lyskom-insert-string 'message-sent)
(lyskom-handle-as-personal-message
(if to-conf-stat
(lyskom-format 'message-sent-to-user
string (conf-stat->name to-conf-stat))
(lyskom-format 'message-sent-to-all string)))
(lyskom-insert-before-prompt
(lyskom-get-string 'message-nope)))
(lyskom-get-string 'message-nope)))
(lyskom-end-of-command))
......
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