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

Fixed bugs in use of lyskom-read-conf-no and in a couple of strings.

parent d7be23a4
No preview for this file type
...@@ -223,7 +223,7 @@ as TYPE. If no such misc-info, return NIL" ...@@ -223,7 +223,7 @@ as TYPE. If no such misc-info, return NIL"
(let* ((tono (or pers-no (let* ((tono (or pers-no
(lyskom-read-conf-no (lyskom-read-conf-no
(lyskom-get-string 'who-letter-to) (lyskom-get-string 'who-letter-to)
'all))) 'all nil nil t)))
(conf-stat (blocking-do 'get-conf-stat tono))) (conf-stat (blocking-do 'get-conf-stat tono)))
(if (if (zerop (conf-stat->msg-of-day conf-stat)) (if (if (zerop (conf-stat->msg-of-day conf-stat))
t t
...@@ -911,7 +911,7 @@ Don't ask for confirmation." ...@@ -911,7 +911,7 @@ Don't ask for confirmation."
(lyskom-change-pres-or-motd-2 (lyskom-change-pres-or-motd-2
(let ((no (lyskom-read-conf-no (let ((no (lyskom-read-conf-no
(lyskom-get-string 'what-to-change-pres-you) (lyskom-get-string 'what-to-change-pres-you)
'all t))) 'all t nil t)))
(if (zerop no) (if (zerop no)
(setq no lyskom-pers-no)) (setq no lyskom-pers-no))
(blocking-do 'get-conf-stat no)) (blocking-do 'get-conf-stat no))
...@@ -923,7 +923,7 @@ Don't ask for confirmation." ...@@ -923,7 +923,7 @@ Don't ask for confirmation."
(interactive) (interactive)
(lyskom-change-pres-or-motd-2 (lyskom-change-pres-or-motd-2
(let ((no (lyskom-read-conf-no (lyskom-get-string 'who-to-put-motd-for) (let ((no (lyskom-read-conf-no (lyskom-get-string 'who-to-put-motd-for)
'all t))) 'all t nil t)))
(if (zerop no) (if (zerop no)
(setq no lyskom-pers-no)) (setq no lyskom-pers-no))
(blocking-do 'get-conf-stat no)) (blocking-do 'get-conf-stat no))
...@@ -1368,7 +1368,7 @@ If MARK-NO == 0, review all marked texts." ...@@ -1368,7 +1368,7 @@ If MARK-NO == 0, review all marked texts."
"Change the password for a person." "Change the password for a person."
(interactive) (interactive)
(let ((pers-no (lyskom-read-conf-no (lyskom-get-string 'whos-passwd) (let ((pers-no (lyskom-read-conf-no (lyskom-get-string 'whos-passwd)
'pers 'empty "")) 'pers 'empty "" t))
(old-pw (silent-read (lyskom-get-string 'old-passwd))) (old-pw (silent-read (lyskom-get-string 'old-passwd)))
(new-pw1 (silent-read (lyskom-get-string 'new-passwd))) (new-pw1 (silent-read (lyskom-get-string 'new-passwd)))
(new-pw2 (silent-read (lyskom-get-string 'new-passwd-again)))) (new-pw2 (silent-read (lyskom-get-string 'new-passwd-again))))
...@@ -1421,12 +1421,12 @@ If MARK-NO == 0, review all marked texts." ...@@ -1421,12 +1421,12 @@ If MARK-NO == 0, review all marked texts."
(interactive) (interactive)
(let ((who-info-list (blocking-do 'who-is-on))) (let ((who-info-list (blocking-do 'who-is-on)))
(lyskom-insert (lyskom-insert
(lyskom-return-who-info-line " " (lyskom-return-who-info-line " "
(lyskom-get-string 'lyskom-name) (lyskom-get-string 'lyskom-name)
(lyskom-get-string 'is-in-conf))) (lyskom-get-string 'is-in-conf)))
(if kom-show-where-and-what (if kom-show-where-and-what
(lyskom-insert (lyskom-insert
(lyskom-return-who-info-line " " (lyskom-return-who-info-line " "
(lyskom-get-string 'from-machine) (lyskom-get-string 'from-machine)
(lyskom-get-string 'is-doing)))) (lyskom-get-string 'is-doing))))
...@@ -1467,7 +1467,7 @@ MY-SESSION-NO is the session number of the running session. ...@@ -1467,7 +1467,7 @@ MY-SESSION-NO is the session number of the running session.
'lyskom-insert))) 'lyskom-insert)))
(funcall insertfun (funcall insertfun
(lyskom-return-who-info-line-as-state (lyskom-return-who-info-line-as-state
(format "%4d%s" (format "%5d%s"
(who-info->connection who-info) (who-info->connection who-info)
(if (= my-session-no (who-info->connection who-info)) (if (= my-session-no (who-info->connection who-info))
"*" "*"
...@@ -1479,7 +1479,7 @@ MY-SESSION-NO is the session number of the running session. ...@@ -1479,7 +1479,7 @@ MY-SESSION-NO is the session number of the running session.
(if kom-show-where-and-what (if kom-show-where-and-what
(funcall insertfun (funcall insertfun
(lyskom-return-who-info-line-as-state (lyskom-return-who-info-line-as-state
" " " "
(lyskom-return-username who-info) (lyskom-return-username who-info)
(concat "(" (concat "("
(who-info->doing-what who-info) (who-info->doing-what who-info)
...@@ -1498,25 +1498,27 @@ MY-SESSION-NO is the session number of the running session. ...@@ -1498,25 +1498,27 @@ MY-SESSION-NO is the session number of the running session.
(defun lyskom-return-who-info-line-as-state (prefix arg1 arg2) (defun lyskom-return-who-info-line-as-state (prefix arg1 arg2)
"Return the format state appropriate for the arguments and "Return the format state appropriate for the arguments and
the window width." the window width."
(let ((formatstring (let* ((adj1 (+ (length prefix) 2))
(concat prefix (adj2 (+ adj1 1))
"%=-" (formatstring
(int-to-string (/ (* 37 (- (lyskom-window-width) 7)) 73)) (concat prefix
(if (lyskom-conf-stat-p arg1) "%=-"
(if (conf-type->letterbox (int-to-string (/ (* 37 (- (lyskom-window-width) adj1)) 73))
(conf-stat->conf-type arg1)) (if (lyskom-conf-stat-p arg1)
"#1P" (if (conf-type->letterbox
"#1M") (conf-stat->conf-type arg1))
"#1s") "#1P"
" %=-" "#1M")
(int-to-string (/ (* 37 (- (lyskom-window-width) 8)) 73)) "#1s")
(if (lyskom-conf-stat-p arg2) " %=-"
(if (conf-type->letterbox (int-to-string (/ (* 37 (- (lyskom-window-width) adj2)) 73))
(conf-stat->conf-type arg2)) (if (lyskom-conf-stat-p arg2)
"#2P" (if (conf-type->letterbox
"#2M") (conf-stat->conf-type arg2))
"#2s") "#2P"
"\n"))) "#2M")
"#2s")
"\n")))
(lyskom-format formatstring arg1 arg2))) (lyskom-format formatstring arg1 arg2)))
......
...@@ -119,7 +119,7 @@ otherwise: the conference is read with lyskom-completing-read." ...@@ -119,7 +119,7 @@ otherwise: the conference is read with lyskom-completing-read."
(let ((conf-no (let ((conf-no
(or conf-no (or conf-no
(lyskom-read-conf-no (lyskom-get-string 'conf-for-status) (lyskom-read-conf-no (lyskom-get-string 'conf-for-status)
'all))) 'all nil nil t)))
conf-stat) conf-stat)
(cache-del-conf-stat conf-no) (cache-del-conf-stat conf-no)
(setq conf-stat (blocking-do 'get-conf-stat conf-no)) (setq conf-stat (blocking-do 'get-conf-stat conf-no))
...@@ -292,7 +292,7 @@ otherwise: the conference is read with lyskom-completing-read." ...@@ -292,7 +292,7 @@ otherwise: the conference is read with lyskom-completing-read."
(let ((pers-no (let ((pers-no
(or pers-no (or pers-no
(lyskom-read-conf-no (lyskom-get-string 'pers-for-status) (lyskom-read-conf-no (lyskom-get-string 'pers-for-status)
'pers ""))) 'pers "" nil t)))
conf-stat conf-stat
pers-stat) pers-stat)
(cache-del-conf-stat pers-no) (cache-del-conf-stat pers-no)
...@@ -495,7 +495,7 @@ otherwise: the conference is read with lyskom-completing-read." ...@@ -495,7 +495,7 @@ otherwise: the conference is read with lyskom-completing-read."
(if (string-match "^19" emacs-version) (if (string-match "^19" emacs-version)
(cons lyskom-last-personal-message-sender 0) (cons lyskom-last-personal-message-sender 0)
lyskom-last-personal-message-sender) lyskom-last-personal-message-sender)
""))))) ""))) t))
message)) message))
...@@ -1373,7 +1373,7 @@ membership info." ...@@ -1373,7 +1373,7 @@ membership info."
(interactive) (interactive)
(let* ((conf-no (lyskom-read-conf-no (let* ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-conf-to-change) (lyskom-get-string 'what-conf-to-change)
'confs nil "")) 'confs nil "" t))
(open (j-or-n-p (lyskom-get-string 'anyone-member))) (open (j-or-n-p (lyskom-get-string 'anyone-member)))
(secret (if (not open) (secret (if (not open)
(j-or-n-p (lyskom-get-string 'secret-conf)))) (j-or-n-p (lyskom-get-string 'secret-conf))))
......
...@@ -335,6 +335,7 @@ and you have finished reading. Please come back later. ...@@ -335,6 +335,7 @@ and you have finished reading. Please come back later.
(your-memberships . "Your LysKOM conference subscriptions:\n") (your-memberships . "Your LysKOM conference subscriptions:\n")
(memberships-header . "Last access Prio Unread Conference\n") (memberships-header . "Last access Prio Unread Conference\n")
(memberships-line . "%#16s %#2d\t%#3d\t%#4M\n")
(conf-for-status . "Get status of which conference: ") (conf-for-status . "Get status of which conference: ")
(no-such-conf . "The conference doesn't exist.") (no-such-conf . "The conference doesn't exist.")
......
...@@ -482,7 +482,8 @@ Otherwise return nil." ...@@ -482,7 +482,8 @@ Otherwise return nil."
t t
(or (and (conf-stat->conf-no conf-stat) (or (and (conf-stat->conf-no conf-stat)
(conf-stat->name conf-stat)) (conf-stat->name conf-stat))
""))) "")
t))
(if (/= conf 0) (if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter))) (setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action)) (setq action (lyskom-filter-read-action))
...@@ -519,7 +520,8 @@ Otherwise return nil." ...@@ -519,7 +520,8 @@ Otherwise return nil."
t t
(or (and auth-stat (or (and auth-stat
(conf-stat->name auth-stat)) (conf-stat->name auth-stat))
""))) "")
t))
(if (/= author 0) (if (/= author 0)
(setq filter (cons (cons 'author-no author) filter))) (setq filter (cons (cons 'author-no author) filter)))
(setq conf (lyskom-read-conf-no (setq conf (lyskom-read-conf-no
...@@ -529,7 +531,8 @@ Otherwise return nil." ...@@ -529,7 +531,8 @@ Otherwise return nil."
(or (or
(and conf-stat (and conf-stat
(conf-stat->name conf-stat)) (conf-stat->name conf-stat))
""))) "")
t))
(if (/= conf 0) (if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter))) (setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action)) (setq action (lyskom-filter-read-action))
...@@ -606,7 +609,8 @@ the current text" ...@@ -606,7 +609,8 @@ the current text"
'all t 'all t
(or (and (conf-stat->conf-no conf-stat) (or (and (conf-stat->conf-no conf-stat)
(conf-stat->name conf-stat)) (conf-stat->name conf-stat))
""))) "")
t))
(if (/= conf 0) (if (/= conf 0)
(setq filter (cons (cons 'recipient-no conf) filter))) (setq filter (cons (cons 'recipient-no conf) filter)))
(setq action (lyskom-filter-read-action)) (setq action (lyskom-filter-read-action))
......
...@@ -171,8 +171,11 @@ Handler to implement remote control of the ansaphone." ...@@ -171,8 +171,11 @@ Handler to implement remote control of the ansaphone."
(string-match (string-match
"^Remote-command: \\([0-9]+\\) \\([0-9]+\\)\n\\(.*\\)\n\\(\\(\n\\|.\\)*\\)$" "^Remote-command: \\([0-9]+\\) \\([0-9]+\\)\n\\(.*\\)\n\\(\\(\n\\|.\\)*\\)$"
text))) text)))
(is-trusted (memq (conf-stat->conf-no sender) (is-trusted (or (memq (conf-stat->conf-no sender)
kom-remote-controllers))) kom-remote-controllers)
(and kom-self-control
(eq (conf-stat->conf-no sender)
lyskom-pers-no)))))
(cond ((not is-remote) nil) (cond ((not is-remote) nil)
(is-from-me t) (is-from-me t)
((not is-to-me) t) ((not is-to-me) t)
......
...@@ -89,7 +89,7 @@ The defaults for this command is the conference that you are in." ...@@ -89,7 +89,7 @@ The defaults for this command is the conference that you are in."
((< count 0) ((< count 0)
(lyskom-format 'first-n (- count)))))) (lyskom-format 'first-n (- count))))))
(by (lyskom-read-conf-no (lyskom-format 'info-by-whom info) (by (lyskom-read-conf-no (lyskom-format 'info-by-whom info)
'pers 'empty)) 'pers 'empty nil t))
(to (lyskom-read-conf-no (lyskom-format 'info-to-conf info) (to (lyskom-read-conf-no (lyskom-format 'info-to-conf info)
'all 'all
;; If person is not given we must give ;; If person is not given we must give
...@@ -99,7 +99,8 @@ The defaults for this command is the conference that you are in." ...@@ -99,7 +99,8 @@ The defaults for this command is the conference that you are in."
"" ""
(conf-stat->name (conf-stat->name
(blocking-do 'get-conf-stat (blocking-do 'get-conf-stat
lyskom-current-conf)))))) lyskom-current-conf)))
t)))
;; Since we fetch everything anyway we don't need to do this. If ;; Since we fetch everything anyway we don't need to do this. If
;; we later choose to fetch all in small chunks we will have to do ;; we later choose to fetch all in small chunks we will have to do
......
...@@ -345,7 +345,7 @@ du har l\344st klart allting. Kom tillbaks senare. ...@@ -345,7 +345,7 @@ du har l\344st klart allting. Kom tillbaks senare.
(your-memberships . "Ditt medlemskap i olika KOM-m\366ten:\n") (your-memberships . "Ditt medlemskap i olika KOM-m\366ten:\n")
(memberships-header . "Senast inne Prio Ol\344sta M\366tesnamn\n") (memberships-header . "Senast inne Prio Ol\344sta M\366tesnamn\n")
(memberships-line . "%#1s %#2d\t%#3d\t%#4M\n") (memberships-line . "%#16s %#2d\t%#3d\t%#4M\n")
(conf-for-status . "Vilket m\366te vill du se statusen f\366r? ") (conf-for-status . "Vilket m\366te vill du se statusen f\366r? ")
(no-such-conf . "M\366tet finns ej.") (no-such-conf . "M\366tet finns ej.")
(status-record . "Status f\366r m\366te %#1M (%#2m) %#3s\n\n") (status-record . "Status f\366r m\366te %#1M (%#2m) %#3s\n\n")
......
...@@ -713,8 +713,14 @@ This is used by the command kom-busy-wait.") ...@@ -713,8 +713,14 @@ This is used by the command kom-busy-wait.")
(defvar kom-remote-control t (defvar kom-remote-control t
"*t if LysKOM may be remotely controlled.") "*t if LysKOM may be remotely controlled.")
(defvar kom-remote-controllers nil (defvar kom-remote-controllers nil
"*Persons who may control LysKOM using messages.") "*Persons who may control LysKOM using messages.By default you can
always control your own sessions. See kom-self-control for more
information.")
(defvar kom-self-control t
"*If non-nil, remote control commands are accepted from sessions logged
in as the same user as the current session.")
(defvar kom-permanent-filter-list nil (defvar kom-permanent-filter-list nil
"*List of patterns to filter permanently") "*List of patterns to filter permanently")
...@@ -930,7 +936,7 @@ the value of kom-tell-phrases for fun.") ...@@ -930,7 +936,7 @@ the value of kom-tell-phrases for fun.")
(make-face 'kom-presence-face) (make-face 'kom-presence-face)
(make-face-italic 'kom-presence-face nil t) (make-face-italic 'kom-presence-face nil t)
(set-face-foreground 'kom-presence-face (set-face-foreground 'kom-presence-face
"Gray"))) "DimGray")))
(progn (progn
(lyskom-make-face 'kom-active-face (lyskom-make-face 'kom-active-face
(copy-face 'underline 'kom-active-face)) (copy-face 'underline 'kom-active-face))
......
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