Commit 6bb92fd9 authored by David Byers's avatar David Byers
Browse files

Diverse fixar

parent 6fc7b8b0
No preview for this file type
......@@ -25,7 +25,7 @@
# $Id$
#
CLIENTVERSION = 0.39a
CLIENTVERSION = 0.39
GENERIC-CLEAN = *~ *.o core
GENERIC-DIST-CLEAN = TAGS
......
......@@ -37,28 +37,6 @@
"$Id$\n"))
(defvar kom-ansaphone-replies
'((group nil nil nil nil)
(common nil nil nil nil))
"*List of automatic replies to various messages.
A list of (MESSAGE-TYPE SENDER RECIPIENT TEXT REPLY)
MESSAGE-TYPE is one of personal, group or common or nil
SENDER is a list of integers or a single integer or nil
RECIPIENT is a list of integers or a single integer or nil
TEXT is a regular expression or nil
REPLY is a string or nil
When an incoming message arrives and the auto-reply facility is on,
this list is checked for automatic replies. The message type, sender,
recipient and text of the incoming messages is matched against the
elements of this list. If a match is found, the corresponding reply is
send. A nil in one of the message-type, sender, recipient or text
components in the list is taken to mean a wildcard. A null reply means
don't send a reply.
If none of the elements match, KOM-ANSAPHONE-DEFAULT-REPLY is sent.")
(defvar lyskom-ansaphone-messages nil
"Messages collected by the automatic reply facility.
The most recent message is the first message in the list.")
......@@ -157,13 +135,12 @@ See kom-ansaphone-on"
(match-end 1)))))
(if (and kom-ansaphone-on
sender
(not (eq sender 0))
recipient
(not is-automatic))
(let ((reply (lyskom-ansaphone-find-reply
message-type
(conf-stat->conf-no sender)
;; Could this be the problem /davidk
(cond ((numberp recipient) recipient)
(conf-stat->conf-no sender)
(cond ((numberp recipient) recipient)
(t (conf-stat->conf-no recipient)))
text)))
(if (and reply (elt reply 4))
......
......@@ -344,11 +344,11 @@ Non-nil NOBEEP means don't beep."
message
(cond
((stringp sender) sender)
(sender (conf-stat->name sender))
(sender sender)
(t (lyskom-get-string 'unknown)))
(cond
((stringp recipient) recipient)
(recipient (conf-stat->name recipient))
(recipient recipient)
(t (lyskom-get-string 'unknown)))
when)))))
......
......@@ -95,7 +95,7 @@ MAP may be nil if there are no new texts."
(set-buffer buffer)
(goto-char (point-max))
(lyskom-format-insert 'memberships-line
(lyskom-return-time (membership->last-time-read
(lyskom-return-date-and-time (membership->last-time-read
membership))
(membership->priority membership)
(if map
......@@ -163,7 +163,7 @@ otherwise: the conference is read with lyskom-completing-read."
"\n"
"")))
(lyskom-format-insert 'created-at
(lyskom-return-time
(lyskom-return-date-and-time
(conf-stat->creation-time conf-stat)))
(lyskom-format-insert 'members
(conf-stat->no-of-members conf-stat))
......@@ -175,7 +175,7 @@ otherwise: the conference is read with lyskom-completing-read."
(1- (+ (conf-stat->no-of-texts conf-stat)
(conf-stat->first-local-no conf-stat))))
(lyskom-format-insert 'last-text-time
(lyskom-return-time
(lyskom-return-date-and-time
(conf-stat->last-written conf-stat)))
(lyskom-format-insert 'no-of-motd
(conf-stat->msg-of-day conf-stat))
......@@ -262,8 +262,10 @@ otherwise: the conference is read with lyskom-completing-read."
(if (or (null member-conf-stat)
(null membership))
(lyskom-insert-string 'secret-membership)
(lyskom-print-date-and-time
(membership->last-time-read membership))
(lyskom-insert
(format "%17s"
(lyskom-return-date-and-time
(membership->last-time-read membership))))
(let ((unread (- (+ (conf-stat->first-local-no conf-stat)
(conf-stat->no-of-texts conf-stat))
(membership->last-text-read membership)
......@@ -306,7 +308,7 @@ otherwise: the conference is read with lyskom-completing-read."
conf-stat
conf-stat)
(lyskom-format-insert 'created-time
(lyskom-return-time
(lyskom-return-date-and-time
(conf-stat->creation-time conf-stat)))
(lyskom-format-insert 'created-confs
......@@ -335,7 +337,7 @@ otherwise: the conference is read with lyskom-completing-read."
(% (pers-stat->total-time-present pers-stat)
60)))
(lyskom-format-insert 'last-log-in
(lyskom-return-time
(lyskom-return-date-and-time
(pers-stat->last-login pers-stat)))
(lyskom-format-insert 'user-name
(pers-stat->username pers-stat))
......@@ -345,7 +347,7 @@ otherwise: the conference is read with lyskom-completing-read."
(lyskom-format-insert 'marked-texts
(pers-stat->no-of-marks pers-stat)))
(lyskom-format-insert 'time-for-last-letter
(lyskom-return-time
(lyskom-return-date-and-time
(conf-stat->last-written conf-stat)))
(let ((superconf
......@@ -425,8 +427,10 @@ otherwise: the conference is read with lyskom-completing-read."
(if (or (null member-conf-stat)
(null membership))
(lyskom-insert-string 'secret-membership)
(lyskom-print-date-and-time
(membership->last-time-read membership))
(lyskom-insert
(format "%17s"
(lyskom-return-date-and-time
(membership->last-time-read membership))))
(let ((unread (- (+ (conf-stat->first-local-no
member-conf-stat)
(conf-stat->no-of-texts
......@@ -471,16 +475,27 @@ otherwise: the conference is read with lyskom-completing-read."
'all t
;; Initial string:
(cond
((null kom-send-message-to-last-sender) nil)
((and (eq kom-send-message-to-last-sender 'group)
((eq kom-default-message-recipient 'everybody) nil)
((and (eq kom-default-message-recipient 'group)
lyskom-last-group-message-recipient)
(if (string-match "^19" emacs-version)
(cons lyskom-last-group-message-recipient 0)))
(lyskom-last-personal-message-sender
((or (and (eq kom-default-message-recipient 'group)
(null lyskom-last-group-message-recipient))
(and (eq kom-default-message-recipient 'sender)
lyskom-last-personal-message-sender))
(if (string-match "^19" emacs-version)
(cons lyskom-last-personal-message-sender 0)
lyskom-last-personal-message-sender))
(t ""))))
(t
(if lyskom-last-personal-message-sender
(if (string-match "^19" emacs-version)
(cons lyskom-last-personal-messsage-sender 0)
lyskom-last-personal-message-sender)
"")))))
message))
......
......@@ -475,21 +475,25 @@ Returns the name."
(try-completion string who-list nil))
((eq all t) ; all-completions
(all-completions string who-list nil))
((eq all 'lambda) ; exact match
(and (assoc string who-list) t)))))
((eq all 'lambda) ; exact match
(and (assoc string who-list) t))
((eq all 'session-no) ; get number
(car-safe (assoc string who-list))))))
(cond ((eq all 'session-no)
(if partial
(let ((output nil)
(list who-list)
(num (string-to-number string))
(conf-no (lyskom-read-conf-name-internal string
predicate
'conf-no)))
predicate
'conf-no)))
(while list
(if (eq conf-no (who-info->pers-no (cdr (car list))))
(if (or (eq conf-no (who-info->pers-no (cdr (car list))))
(eq num (who-info->connection (cdr (car list)))))
(setq output (cons
(who-info->connection (cdr (car list)))
output)))
(setq list (cdr list)))
output)
result))
(list (string-to-number result))))
(t (or partial result)))))
......@@ -614,9 +614,9 @@ Personal message from %#1P (%#3s):
")
(message-from-to .
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Group message to %#3s from %#2s (%#4s):
Group message to %#3M from %#2P (%#4s):
%#1s
%#1t
----------------------------------------------------------------
") (text-is-created . "Article %#1d has been created!")
......@@ -867,7 +867,7 @@ Text:
(kom-review-backward "(Review) Backwards")
(kom-view-next-text "(Read) next article")
(kom-who-is-on "Who (is on)")
(kom-display-who-buffer "Display who (list)")
; (kom-display-who-buffer "Display who (list)")
(kom-busy-wait "Wait (for news)")
(kom-write-comment "(Write) comment")
(kom-comment-previous "(Write) comment (to) previous article")
......
No preview for this file type
......@@ -37,14 +37,35 @@
"$Id$\n"))
(defvar lyskom-personal-message-handlers nil
"A list of personal message handlers.")
"A list of personal message handlers.
(defvar lyskom-message-current-text "")
Each element of the list is a function of four arguments, MESSAGE-TYPE
SENDER RECIPIENT and TEXT. MESSAGE-TYPE is one of personal, group or
common and denotes the type of message. SENDER is the conf-stat of the
sender of the message. RECIPIENT is the conf-stat of the message
recipient or zero for common messages.
The functions may use the lyskom-set-current-message-text function to
modify the message text. A non-nil return value from the function
indicates that the message was handlerd and no other handlers need to
be called and a nil return value means that the message was not
handled and should be sent to the next handler.")
(defvar lyskom-message-current-text ""
"The text of the current message. Use
lyskom-set-current-message-text to modify this variable.")
(defun lyskom-set-current-message-text (text)
"Set the current message text to TEXT. For use by personal message
handlers."
(setq lyskom-message-current-text text))
(defun lyskom-handle-personal-message (sender recipient text)
"Handle a personal message.
SENDER is the sender of the message (a conf-stat) RECIPIENT is the
recipient of the message (a conf-stat or zero for common
messages. TEXT is the text of the message."
(let ((message-type (cond ((eq recipient 0) 'common)
((= (conf-stat->conf-no recipient)
lyskom-pers-no) 'personal)
......
......@@ -173,8 +173,9 @@ See lyskom-mode for details."
'pers 'conf-no)))
(if lyskom-pers-no
nil
(let ((name (lyskom-read-conf-name (lyskom-get-string 'what-is-your-name)
'pers nil "")))
(let ((name (lyskom-read-conf-name
(lyskom-get-string 'what-is-your-name)
'pers nil "")))
(setq lyskom-pers-no
(or (lyskom-read-conf-name-internal name 'pers 'conf-no)
(lyskom-create-new-person name)))))
......
......@@ -641,9 +641,9 @@ Personligt meddelande fr\345n %#1P (%#3s):
")
(message-from-to .
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gruppmeddelande till %#3s fr\345n %#2s (%#4s):
Gruppmeddelande till %#3M fr\345n %#2P (%#4s):
%#1s
%#1t
----------------------------------------------------------------
")
(text-is-created . "Text %#1n \344r skapad!")
......@@ -902,7 +902,7 @@ Text:
(kom-review-backward "(\305terse) Bakl\344nges")
(kom-view-next-text "L\344sa n\344sta inl\344gg")
(kom-who-is-on "Vilka \344r inloggade")
(kom-display-who-buffer "Visa vilkalistan")
; (kom-display-who-buffer "Visa vilkalistan")
(kom-busy-wait "V\344nta p\345 ett inl\344gg")
(kom-write-comment "Kommentera inl\344gget")
(kom-comment-previous "Kommentera f\366reg\345ende inl\344gg")
......
......@@ -194,12 +194,17 @@ program named by kom-audio-player.")
(defvar kom-audio-player "audioplay"
"*Program to play audio files.")
(defvar kom-send-message-to-last-sender t
"*Who to send messages to.
Non-nil means default recipient of messages is the sender of the last
personal message received. If the last message was a group message,
the default recipient will be the recipient of that message, unless
this variable is 'group. Nil means default is everybody.")
(defvar kom-default-message-recipient 'group
"*Determines default recipient of personal messages.
everybody means the default recipient is everybody.
group means the default recipient is the group to which the last
message was sent, if it was a group message. If the last message was a
personal message or a common message, it means the same as sender.
sender means the sender of the last message received.")
(defvar lyskom-filter-outgoing-messages t
"t if outgoing remote-control messages and automatic replies are not
......@@ -228,6 +233,7 @@ various LysKOM elements.")
(("Visa presentation" . lyskom-button-view-conf-presentation)
("Visa mötesstatus" . lyskom-button-view-conf-status)
("Gå till mötet" . lyskom-button-goto-conf)
("Skicka gruppmeddelande" . lyskom-button-send-message)
("Bli medlem i mötet" . lyskom-button-add-self)
("Utträd ur mötet" . lyskom-button-sub-self))
((kom-list-news . lyskom-button-goto-conf)))
......@@ -376,6 +382,7 @@ he gets a y-or-n-p question for all recipients.")
kom-quit-hook
kom-show-where-and-what
kom-who-buffer-size-when-displaying
kom-default-message-recipient
kom-write-texts-in-window
kom-remote-control
kom-remote-controllers
......@@ -707,10 +714,28 @@ This is used by the command kom-busy-wait.")
(defvar kom-session-filter-list nil
"List of patterns to filter during this session")
kom-remote-control
kom-remote-controllers
kom-ansaphone-on
kom-ansaphone-default-reply
(defvar kom-ansaphone-replies
'((group nil nil nil nil)
(common nil nil nil nil))
"*List of automatic replies to various messages.
A list of (MESSAGE-TYPE SENDER RECIPIENT TEXT REPLY)
MESSAGE-TYPE is one of personal, group or common or nil
SENDER is a list of integers or a single integer or nil
RECIPIENT is a list of integers or a single integer or nil
TEXT is a regular expression or nil
REPLY is a string or nil
When an incoming message arrives and the auto-reply facility is on,
this list is checked for automatic replies. The message type, sender,
recipient and text of the incoming messages is matched against the
elements of this list. If a match is found, the corresponding reply is
send. A nil in one of the message-type, sender, recipient or text
components in the list is taken to mean a wildcard. A null reply means
don't send a reply.
If none of the elements match, KOM-ANSAPHONE-DEFAULT-REPLY is sent.")
(defvar lyskom-filter-list nil
"List of patterns that are filtered.")
......@@ -884,10 +909,11 @@ the value of kom-tell-phrases for fun.")
(copy-face 'kom-text-face 'kom-text-no-face))
(lyskom-make-face 'kom-presence-face
(make-face 'kom-presence-face)
(make-face-italic 'kom-presence-face)
(cond ((eq bgmode 'dark)
(set-face-foreground '
kom-presence-face "DarkGray"))
(make-face-italic 'kom-presence-face nil t)
(cond ((or (null bgmode)
(eq bgmode 'dark))
(set-face-foreground 'kom-presence-face
"DimGray"))
((eq bgmode 'light)
(set-face-foreground
'kom-presence-face "LightGray")))))
......@@ -908,5 +934,5 @@ the value of kom-tell-phrases for fun.")
(copy-face 'default 'kom-subject-face))
(lyskom-make-face 'kom-presence-face
(make-face 'kom-presence-face)
(make-face-italic 'kom-presence-face)))))
(make-face-italic 'kom-presence-face nil t)))))
......
......@@ -80,7 +80,8 @@ lyskom-reading-list to read the comments to this."
(lyskom-format-insert "%#1n "
text-stat)
(lyskom-print-date-and-time (text-stat->creation-time
text-stat))
text-stat)
'time-y-m-d-h-m)
(lyskom-insert
(if (= 1 (text-stat->no-of-lines text-stat))
(lyskom-get-string 'line)
......@@ -319,13 +320,13 @@ recipients to it that the user is a member in."
'yesterday)
(t nil))))
(defun lyskom-print-date-and-time (time)
"Print date and time. Arg: TIME."
(defun lyskom-return-date-and-time (time &optional fmt)
"Return date and time as a string. Arg: TIME."
(let* ((diff (lyskom-calculate-day-diff time)))
(lyskom-format-insert
(lyskom-format
(if (and diff lyskom-print-complex-dates)
(intern (concat (symbol-name diff) "-time-format-string"))
'time-y-m-d-h-m)
(or fmt 'time-yyyy-mm-dd-hh-mm))
(+ (time->year time) 1900)
(1+ (time->mon time))
(time->mday time)
......@@ -333,7 +334,9 @@ recipients to it that the user is a member in."
(time->min time)
(and diff (lyskom-get-string diff)))))
(defun lyskom-print-date-and-time (time &optional fmt)
"Print date and time. Arg: TIME"
(lyskom-insert (lyskom-return-date-and-time time fmt)))
(defun lyskom-print-text (text-stat text mark-as-read text-no)
......@@ -415,13 +418,13 @@ the client. That is done by lyskom-is-read."
(misc-info->local-no misc))
(if (misc-info->sent-at misc)
(lyskom-format-insert 'send-at
(lyskom-return-time
(lyskom-return-date-and-time
(misc-info->sent-at misc))))
(if (misc-info->sender misc)
(lyskom-insert (lyskom-format 'sent-by (misc-info->sender misc))))
(if (misc-info->rec-time misc)
(lyskom-format-insert 'recieved-at
(lyskom-return-time (misc-info->rec-time misc)))))
(lyskom-return-date-and-time (misc-info->rec-time misc)))))
(defun lyskom-view-text-handle-saved-comments (text-stat)
......
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