Commit 6054e749 authored by Ulrik Haugen's avatar Ulrik Haugen
Browse files

created kom-who-is-on-and-friend and helper.

rearranged keybindings for kom-who-*.
parent 7b52a7bf
2001-08-23 Ulrik Haugen <qha@lysator.liu.se>
* commands1.el (kom-who-is-on-and-friend,
lyskom-select-friends-from-who-list): new commands.
(lyskom-who-is-on-8, lyskom-who-is-on-9): new arg;
show-friends-only.
* english-strings.el, swedish-strings.el (lyskom-command): added
kom-who-is-on-and-friend.
* english-strings.el (lyskom-en-mode-map): kom-who-is-on is on
"w l", kom-who-is-on-in-conference is on "w c",
kom-who-is-present-in-conference is on "w a" and
kom-who-is-on-and-friend is on "w f".
* swedish-strings.el (lyskom-sv-mode-map): kom-who-is-on is on
"v i", kom-who-is-on-in-conference is on "v m",
kom-who-is-present-in-conference is on "v a" and
kom-who-is-on-and-friend is on "v v".
2001-08-24 Per Cederqvist <ceder@moria>
* commands2.el (kom-is-person-member-of-conference): Differentiate
......
......@@ -2763,19 +2763,45 @@ If the prefix is 0, all visible sessions are shown."
(lyskom-no-users
(lyskom-insert (lyskom-get-string 'null-who-info))))))
(defun lyskom-who-is-on-8 (&optional conf-stat show-present-only)
;;; ================================================================
;;; Vilka vänner (är inloggade) - What friends are on
;;; Author: Ulrik Haugen
(def-kom-command kom-who-is-on-and-friend (&optional arg)
"Display a list of all connected users in kom-friends.
The prefix arg controls the idle limit of the sessions showed. If the
prefix is negative, invisible sessions are also shown.
If the prefix is 0, all visible sessions are shown."
(interactive "P")
(condition-case nil
(if (lyskom-have-feature dynamic-session-info)
(lyskom-who-is-on-9 arg nil nil t)
(lyskom-who-is-on-8 nil nil t))
(lyskom-no-users
(lyskom-insert (lyskom-get-string 'null-who-info)))))
(defun lyskom-who-is-on-8 (&optional conf-stat show-present-only
show-friends-only)
"Display a list of all connected users.
Uses Protocol A version 8 calls"
(let* ((who-info-list (blocking-do 'who-is-on))
(who-list (sort (cond (show-present-only
(lyskom-who-is-present-check-membership-8 who-info-list conf-stat))
(conf-stat
(lyskom-who-is-on-check-membership-8 who-info-list conf-stat))
(t
(listify-vector who-info-list)))
(function (lambda (who1 who2)
(< (who-info->connection who1)
(who-info->connection who2))))))
(who-list (sort
(funcall (if show-friends-only
#'lyskom-select-friends-from-who-list
#'identity)
(cond (show-present-only
(lyskom-who-is-present-check-membership-8
who-info-list conf-stat))
(conf-stat
(lyskom-who-is-on-check-membership-8
who-info-list conf-stat))
(t
(listify-vector who-info-list))))
(function (lambda (who1 who2)
(< (who-info->connection who1)
(who-info->connection who2))))))
(total-users (length who-list))
(session-width (1+ (length (int-to-string
(who-info->connection
......@@ -2833,7 +2859,8 @@ Uses Protocol A version 8 calls"
'timeformat-day-yyyy-mm-dd-hh-mm-ss)))))
(defun lyskom-who-is-on-9 (arg &optional conf-stat show-present-only)
(defun lyskom-who-is-on-9 (arg &optional conf-stat show-present-only
show-friends-only)
"Display a list of all connected users.
Uses Protocol A version 9 calls"
(let* ((wants-invisibles (or (and (numberp arg) (< arg 0))
......@@ -2845,12 +2872,18 @@ Uses Protocol A version 9 calls"
(t 0))))
(who-info-list (blocking-do 'who-is-on-dynamic
't wants-invisibles (* idle-hide 60)))
(who-list (sort (cond (show-present-only
(lyskom-who-is-present-check-membership-9 who-info-list conf-stat))
(conf-stat
(lyskom-who-is-on-check-membership-9 who-info-list conf-stat))
(t
(listify-vector who-info-list)))
(who-list (sort
(funcall (if show-friends-only
#'lyskom-select-friends-from-who-list
#'identity)
(cond (show-present-only
(lyskom-who-is-present-check-membership-9
who-info-list conf-stat))
(conf-stat
(lyskom-who-is-on-check-membership-9
who-info-list conf-stat))
(t
(listify-vector who-info-list))))
(function
(lambda (who1 who2)
(< (dynamic-session-info->session who1)
......@@ -3063,6 +3096,21 @@ Uses Protocol A version 9 calls"
(setq i (1+ i)))
res))
(defun lyskom-select-friends-from-who-list (who-list)
"Returns a list of friends in WHO-LIST"
(let ((result nil))
(while (not (endp who-list))
(when (memq (dynamic-session-info->person (car who-list))
kom-friends)
(setq result (cons (car who-list) result)))
(setq who-list (cdr who-list)))
result))
;; (dolist (who-info who-list result)
;; (when (memq (dynamic-session-info->person who-info)
;; kom-friends)
;; (setq result (cons who-info result))))))
(defun lyskom-insert-deferred-session-info (session-info defer-info)
(if session-info
(lyskom-replace-deferred defer-info
......
......@@ -1638,6 +1638,7 @@ You must become an active member of the conference to enter it.\n")
. "Who is on in conference")
(kom-who-is-present-in-conference
. "Who is present in conference")
(kom-who-is-on-and-friend . "Which friends are on")
(kom-who-am-i . "Where (am) i")
(kom-list-clients . "List clients")
(kom-busy-wait . "Wait (for news)")
......@@ -1955,6 +1956,7 @@ You must become an active member of the conference to enter it.\n")
(define-prefix-command 'lyskom-en-filter-get-prefix)
(define-prefix-command 'lyskom-en-S-prefix)
(define-prefix-command 'lyskom-en-previous-prefix)
(define-prefix-command 'lyskom-en-who-prefix)
(define-key lyskom-en-mode-map (kbd "A") 'lyskom-en-change-prefix)
(define-key lyskom-en-mode-map (kbd "r") 'lyskom-en-review-prefix)
(define-key lyskom-en-mode-map (kbd "f") 'lyskom-en-filter-get-prefix)
......@@ -1962,6 +1964,7 @@ You must become an active member of the conference to enter it.\n")
(define-key lyskom-en-mode-map (kbd "l") 'lyskom-en-list-prefix)
(define-key lyskom-en-mode-map (kbd "s") 'lyskom-en-S-prefix)
(define-key lyskom-en-mode-map (kbd "b") 'lyskom-en-previous-prefix)
(define-key lyskom-en-mode-map (kbd "w") 'lyskom-en-who-prefix)
(define-key lyskom-en-mode-map (kbd (lyskom-keys 'button2)) 'kom-button-click)
(define-key lyskom-en-mode-map (kbd (lyskom-keys 'button3)) 'kom-popup-menu)
......@@ -2006,8 +2009,6 @@ You must become an active member of the conference to enter it.\n")
(define-key lyskom-en-mode-map (kbd "l s") 'kom-membership)
(define-key lyskom-en-mode-map (kbd "l a") 'kom-list-summary)
(define-key lyskom-en-mode-map (kbd "l f") 'kom-list-filters)
(define-key lyskom-en-mode-map (kbd "l w") 'kom-who-is-on-in-conference)
(define-key lyskom-en-mode-map (kbd "l p") 'kom-who-is-present-in-conference)
(define-key lyskom-en-mode-map (kbd "S") 'kom-add-self)
(define-key lyskom-en-mode-map (kbd "M") 'kom-mark-text)
(define-key lyskom-en-mode-map (kbd "U") 'kom-unmark-text)
......@@ -2025,7 +2026,10 @@ You must become an active member of the conference to enter it.\n")
(define-key lyskom-en-mode-map (kbd "f s") 'kom-filter-subject)
(define-key lyskom-en-mode-map (kbd "f a") 'kom-filter-author)
(define-key lyskom-en-mode-map (kbd "f c") 'kom-filter-text)
(define-key lyskom-en-mode-map (kbd "w") 'kom-who-is-on)
(define-key lyskom-en-mode-map (kbd "w l") 'kom-who-is-on)
(define-key lyskom-en-mode-map (kbd "w c") 'kom-who-is-on-in-conference)
(define-key lyskom-en-mode-map (kbd "w a") 'kom-who-is-present-in-conference)
(define-key lyskom-en-mode-map (kbd "w f") 'kom-who-is-on-and-friend)
(define-key lyskom-en-mode-map (kbd "I") 'kom-who-am-i)
(define-key lyskom-en-mode-map (kbd "W") 'kom-busy-wait)
(define-key lyskom-en-mode-map (kbd "A p") 'kom-change-presentation)
......
......@@ -1635,7 +1635,8 @@ Du m
(kom-who-is-on-in-conference
. "Vilka r inloggade i mte")
(kom-who-is-present-in-conference
. "Vilka r nrvarande i mte")
. "Vilka r nrvarande i mte")
(kom-who-is-on-and-friend . "Vilka vnner r inloggade")
(kom-who-am-i . "Var (r) jag")
; (kom-display-who-buffer "Visa vilkalistan")
(kom-list-clients . "Lista klienter")
......@@ -2360,12 +2361,14 @@ Visar vilka som f
(define-prefix-command 'lyskom-sv-S-prefix)
(define-prefix-command 'lyskom-sv-fast-reply-prefix)
(define-prefix-command 'lyskom-sv-filter-get-prefix)
(define-prefix-command 'lyskom-sv-who-prefix)
(define-key lyskom-sv-mode-map (kbd "f") 'lyskom-sv-filter-get-prefix)
(define-key lyskom-sv-mode-map (kbd "n") 'lyskom-sv-next-prefix)
(define-key lyskom-sv-mode-map (kbd "l") 'lyskom-sv-list-prefix)
(define-key lyskom-sv-mode-map (kbd "s") 'lyskom-sv-S-prefix)
(define-key lyskom-sv-mode-map (kbd "r") 'lyskom-sv-fast-reply-prefix)
(define-key lyskom-sv-mode-map (kbd "v") 'lyskom-sv-who-prefix)
(define-key lyskom-sv-mode-map (lyskom-keys ') 'lyskom-sv-change-prefix)
(define-key lyskom-sv-mode-map (lyskom-keys ') 'lyskom-sv-change-prefix)
(define-key lyskom-sv-mode-map (lyskom-keys ') 'lyskom-sv-review-prefix)
......@@ -2436,8 +2439,6 @@ Visar vilka som f
(define-key lyskom-sv-mode-map (kbd "l {") 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l [") 'kom-list-summary)
(define-key lyskom-sv-mode-map (kbd "l f") 'kom-list-filters)
(define-key lyskom-sv-mode-map (kbd "l v") 'kom-who-is-on-in-conference)
(define-key lyskom-sv-mode-map (kbd "l a") 'kom-who-is-present-in-conference)
(define-key lyskom-sv-mode-map (kbd "m") 'kom-add-self)
(define-key lyskom-sv-mode-map (kbd "M") 'kom-mark-text)
(define-key lyskom-sv-mode-map (kbd "A") 'kom-unmark-text)
......@@ -2462,7 +2463,10 @@ Visar vilka som f
(define-key lyskom-sv-mode-map (kbd "f [") 'kom-filter-subject)
(define-key lyskom-sv-mode-map (kbd "f f") 'kom-filter-author)
(define-key lyskom-sv-mode-map (kbd "f i") 'kom-filter-text)
(define-key lyskom-sv-mode-map (kbd "v") 'kom-who-is-on)
(define-key lyskom-sv-mode-map (kbd "v i") 'kom-who-is-on)
(define-key lyskom-sv-mode-map (kbd "v m") 'kom-who-is-on-in-conference)
(define-key lyskom-sv-mode-map (kbd "v a") 'kom-who-is-present-in-conference)
(define-key lyskom-sv-mode-map (kbd "v v") 'kom-who-is-on-and-friend)
(define-key lyskom-sv-mode-map (kbd "J") 'kom-who-am-i)
(define-key lyskom-sv-mode-map (kbd "V") 'kom-busy-wait)
(define-key lyskom-sv-mode-map (kbd "{ p") 'kom-change-presentation)
......
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