Commit 879cb2e6 authored by Johan Sundström's avatar Johan Sundström
Browse files

Added text-prefix-arg to kom-status-session. Also made same command show...

Added text-prefix-arg to kom-status-session. Also made same command show latest time a person was logged in, when that person was logged out.
parent 9e80aeb1
2002-04-28 Johan Sundstrm <jhs@lysator.liu.se>
* commands1.el (kom-status-session): When a prefix argument is
given, see the status of the author of that text (as given by
lyskom-read-text-no-prefix-arg), otherwise behave as usual.
Also added info on last logout when a person is not available.
* swedish-strings.el, english-strings.el (lyskom-message):
Changed person-not-logged-in-r to optionally state last logout.
* commands2.el (kom-force-logout): Updated to reflect change in
person-not-logged-in-r.
2002-04-28 Johan Sundstrm <jhs@lysator.liu.se>
* commands2.el (kom-status-person): When a prefix argument is
given, review the presentation of the author of that text (as given
by lyskom-read-text-no-prefix-arg), otherwise behave as usual.
given, see the status of the author of that text (as given by
lyskom-read-text-no-prefix-arg), otherwise behave as usual.
* swedish-strings.el, english-strings.el (lyskom-message):
Added text-to-see-author-status-of.
......
......@@ -3360,13 +3360,21 @@ Uses Protocol A version 9 calls"
;;;
;;; Author: David Byers
(def-kom-command kom-status-session (&optional arg)
(def-kom-command kom-status-session (&optional text-or-session-no)
"Show status for all sessions a person has. Asks for person name.
Optional argument ARG should be a list of sessions to get information
about or a single session number."
(interactive "P")
(let ((sessions (or (cond ((listp arg) arg)
((numberp arg) (list arg)))
Optional argument should be a list of sessions to get information
about or a single session number. When used interactively, the prefix
argument is used to find a text whose author's status is shown."
(interactive (and current-prefix-arg ; only peek at textno:s when prefixed!
(list (lyskom-read-text-no-prefix-arg
'text-to-see-author-status-of))))
(let ((sessions (or (when (and text-or-session-no (interactive-p))
(lyskom-session-from-conf
(text-stat->author
(blocking-do 'get-text-stat text-or-session-no))))
(cond
((listp text-or-session-no) text-or-session-no)
((numberp text-or-session-no) (list text-or-session-no)))
(lyskom-read-session-no
(lyskom-get-string 'status-for-session))))
who-info)
......@@ -3374,9 +3382,13 @@ about or a single session number."
(lyskom-insert-string 'no-such-session-r))
((and (numberp (car sessions))
(<= (car sessions) 0))
(lyskom-format-insert
(lyskom-get-string 'person-not-logged-in-r)
(- (car sessions))))
(let ((pers-no (- (car sessions))))
(lyskom-format-insert
(lyskom-get-string 'person-not-logged-in-r)
pers-no
(lyskom-format-time 'date-and-time
(pers-stat->last-login
(blocking-do 'get-pers-stat pers-no))))))
(t
(if (lyskom-have-feature dynamic-session-info)
(progn
......
......@@ -1602,7 +1602,7 @@ Use OLD-MOTD-TEXT as the default text if non-nil."
(lyskom-report-command-answer
(blocking-do 'disconnect session)))
((< session 0)
(lyskom-format-insert 'person-not-logged-in-r (- session)))
(lyskom-format-insert 'person-not-logged-in-r (- session) nil))
(t nil))))
;;; ================================================================
......
......@@ -1308,7 +1308,8 @@ Text:
(who-i-am-emacs . "Running under %#1s%#2?b%[ (MULE)%]%[%].\n")
(no-such-session-r . "That session does not exist. Perhaps the user is not logged on.\n")
(person-not-logged-in-r . "%#1P is not logged on.\n")
(person-not-logged-in-r . "%#1P %#2?b%[has not been logged on since %#2s%]%[is not logged on%].\n")
(session-status . "Session %#1d is %#2P <%#2p>
%#5s %#7s %#4M
Using %#6D from %#3s\n")
......
......@@ -1311,7 +1311,7 @@ Text:
(who-i-am-emacs . "Det krs under %#1s%#2?b%[ (MULE)%]%[%].\n")
(no-such-session-r . "Det finns ingen sdan session. Personen kanske inte r inloggad.\n")
(person-not-logged-in-r . "%#1P r inte inloggad.\n")
(person-not-logged-in-r . "%#1P %#2?b%[har inte varit inloggad sedan %#2s%]%[r inte inloggad%].\n")
(session-status . "Session %#1d r %#2P <%#2p>
%#5s %#7s %#4M
Kr %#6D frn %#3s\n")
......
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