Commit 35941a08 authored by David Byers's avatar David Byers
Browse files

Fixed bugs 280, 293, 224, 345

parent 489a5886
2002-01-02 David Byers <davby@ida.liu.se>
Work on bug 280
* commands1.el (kom-remove-presentation): New command.
* vars.el.in (lyskom-commands): Added kom-set-presentation and
kom-set-motd-text.
* swedish-strings.el (lyskom-command): Added kom-set-presentation
and kom-set-motd.
* commands1.el (kom-set-presentation): New command.
(kom-set-motd): New command
(lyskom-set-pres-or-motd-2): New function.
Various bugs
* vars.el.in (lyskom-button-actions): Set pers actions for
kom-list-news and kom-membership to the values they have for conf
(bug 293).
* commands2.el (kom-force-logout): Reindented.
(kom-force-logout): Handle negative answer from
lyskom-read-session-no (bug 224).
* commands1.el (lyskom-misc-infos-from-list): Made this function
nonrecursive (bug 345)
2001-12-15 Ulrik Haugen <qha@lysator.liu.se> 2001-12-15 Ulrik Haugen <qha@lysator.liu.se>
* edit-text.el (lyskom-edit-parse-headers): handle the brackets in * edit-text.el (lyskom-edit-parse-headers): handle the brackets in
......
...@@ -343,11 +343,12 @@ the other ones." ...@@ -343,11 +343,12 @@ the other ones."
(defun lyskom-misc-infos-from-list (type list) (defun lyskom-misc-infos-from-list (type list)
"Get all the misc-infos from the misc-info-list LIST with the same type "Get all the misc-infos from the misc-info-list LIST with the same type
as TYPE. If no such misc-info, return NIL" as TYPE. If no such misc-info, return NIL"
(cond ((null list) nil) (let ((result nil))
((equal type (misc-info->type (car list))) (while list
(cons (car list) (when (equal type (misc-info->type (car list)))
(lyskom-misc-infos-from-list type (cdr list)))) (setq result (cons (car list) result)))
(t (lyskom-misc-infos-from-list type (cdr list))))) (setq list (cdr list)))
result))
;;; ================================================================ ;;; ================================================================
...@@ -1102,12 +1103,31 @@ that text instead." ...@@ -1102,12 +1103,31 @@ that text instead."
(lyskom-insert-string 'confusion-what-to-answer-to)) (lyskom-insert-string 'confusion-what-to-answer-to))
(progn (progn
(lyskom-tell-internat 'kom-tell-write-reply) (lyskom-tell-internat 'kom-tell-write-reply)
(cache-del-conf-stat (text-stat->author text-stat))
(let* ((conf-stat (blocking-do 'get-conf-stat
(text-stat->author text-stat))))
(if (if (zerop (conf-stat->msg-of-day conf-stat))
t
(progn
(recenter 1)
(lyskom-format-insert 'has-motd
conf-stat)
(lyskom-view-text (conf-stat->msg-of-day conf-stat))
(if (lyskom-j-or-n-p (lyskom-get-string 'motd-persist-q))
t
nil)))
(if (= (text-stat->author text-stat) lyskom-pers-no)
(lyskom-edit-text lyskom-proc
(lyskom-create-misc-list 'recpt
(text-stat->author text-stat))
"" "")
(lyskom-edit-text lyskom-proc (lyskom-edit-text lyskom-proc
(lyskom-create-misc-list (lyskom-create-misc-list
'comm-to (text-stat->text-no text-stat) 'comm-to (text-stat->text-no text-stat)
'recpt (text-stat->author text-stat) 'recpt (text-stat->author text-stat)
'recpt lyskom-pers-no) 'recpt lyskom-pers-no)
subject "")))) subject ""))))
)))
;;; ================================================================ ;;; ================================================================
...@@ -1380,7 +1400,82 @@ TYPE is either 'pres or 'motd, depending on what should be changed." ...@@ -1380,7 +1400,82 @@ TYPE is either 'pres or 'motd, depending on what should be changed."
conf-stat)))) conf-stat))))
(def-kom-command kom-set-presentation (arg)
"Add a presentation for a person or conference."
(interactive "P")
(let ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-to-set-pres-you)
'(all) t nil t))
(text-no (lyskom-read-text-no-prefix-arg 'what-text-to-set-as-pres-no t
lyskom-previous-text)))
(when (zerop conf-no)
(setq conf-no lyskom-pers-no))
(lyskom-set-pres-or-motd-2
conf-no
text-no
'pres)))
(def-kom-command kom-set-motd-text (arg)
"Add a presentation for a person or conference."
(interactive "P")
(let ((conf-no (lyskom-read-conf-no
(lyskom-get-string 'what-to-set-pres-you)
'(all) t nil t))
(text-no (lyskom-read-text-no-prefix-arg 'what-text-to-set-as-pres-no t
lyskom-previous-text)))
(when (zerop conf-no)
(setq conf-no lyskom-pers-no))
(lyskom-set-pres-or-motd-2
conf-no
text-no
'motd)))
(defun lyskom-set-pres-or-motd-2 (conf-no text-no what)
(let ((set-pres (eq what 'pres)))
(blocking-do-multiple ((conf-stat (get-conf-stat conf-no))
(text-stat (get-text-stat text-no)))
(cond ((null conf-stat)
(lyskom-format-insert 'no-such-conf-or-pers))
((null text-stat)
(lyskom-format-insert 'no-such-text-no text-no))
(t
(let ((existing (if set-pres
(conf-stat->presentation conf-stat)
(conf-stat->msg-of-day conf-stat))))
(when (or (zerop existing)
(progn (lyskom-view-text existing)
(lyskom-j-or-n-p
(lyskom-get-string (if set-pres
'conf-already-has-pres
'conf-already-has-motd)))))
(cache-del-conf-stat conf-no)
(cache-del-text-stat text-no)
(lyskom-format-insert (if set-pres
'setting-conf-pres
'setting-conf-motd)
conf-stat text-no)
(lyskom-report-command-answer
(cond ((eq what 'pres)
(blocking-do 'set-presentation conf-no text-no))
((eq what 'motd)
(blocking-do 'set-conf-motd conf-no text-no)))))))))))
(def-kom-command kom-remove-presentation ()
"Removes a presentation for a person or a conference."
(interactive)
(let ((conf-stat (or (lyskom-read-conf-stat
(lyskom-get-string 'who-to-remove-pres-for)
'(all) t nil t)
(blocking-do 'get-conf-stat lyskom-pers-no))))
(cond ((null conf-stat)
(lyskom-insert-string 'cant-get-conf-stat))
((zerop (conf-stat->presentation conf-stat))
(lyskom-format-insert 'has-no-presentation conf-stat))
(t
(lyskom-format-insert 'removing-pres-for-conf conf-stat
(conf-stat->presentation conf-stat))
(lyskom-report-command-answer
(blocking-do 'set-presentation (conf-stat->conf-no conf-stat) 0))))))
;;; ================================================================ ;;; ================================================================
;;; Ta bort lapp p} d|rren - delete conf-motd ;;; Ta bort lapp p} d|rren - delete conf-motd
......
...@@ -1531,18 +1531,19 @@ on one line." ...@@ -1531,18 +1531,19 @@ on one line."
;;; Author: Inge Wallin ;;; Author: Inge Wallin
(def-kom-command kom-force-logout () (def-kom-command kom-force-logout ()
"Force another user to log out." "Force another user to log out."
(interactive) (interactive)
(let ((session (car-safe (lyskom-read-session-no (let ((session (car-safe (lyskom-read-session-no
(lyskom-get-string 'who-to-throw-out) (lyskom-get-string 'who-to-throw-out)
nil nil t)))) nil nil t))))
(if session (cond ((> session 0)
(progn
(lyskom-format-insert 'throwing-out session) (lyskom-format-insert 'throwing-out session)
(lyskom-report-command-answer (lyskom-report-command-answer
(blocking-do 'disconnect session)))))) (blocking-do 'disconnect session)))
((< session 0)
(lyskom-format-insert 'person-not-logged-in-r (- session)))
(t nil))))
;;; ================================================================ ;;; ================================================================
;;; Skjut upp l{sning - postpone ;;; Skjut upp l{sning - postpone
...@@ -2537,3 +2538,4 @@ configurable variable `kom-review-marks-texts-as-read' in the current buffer." ...@@ -2537,3 +2538,4 @@ configurable variable `kom-review-marks-texts-as-read' in the current buffer."
configurable variable `kom-review-marks-texts-as-read' in the current buffer." configurable variable `kom-review-marks-texts-as-read' in the current buffer."
(interactive) (interactive)
(setq kom-review-marks-texts-as-read nil)) (setq kom-review-marks-texts-as-read nil))
...@@ -336,6 +336,18 @@ and you have finished reading. Please come back later. ...@@ -336,6 +336,18 @@ and you have finished reading. Please come back later.
(what-to-change-faq-you . "Change FAQ for which conference: ") (what-to-change-faq-you . "Change FAQ for which conference: ")
(who-to-put-motd-for . "Post notice on whom/what (yourself): ") (who-to-put-motd-for . "Post notice on whom/what (yourself): ")
(what-to-set-pres-you . "Set presentation for whom/what (yourself): ")
(what-text-to-set-as-pres-no . "Which text do you want as the new presentation: ")
(what-to-set-motd-you . "Set notice on whom/what (yourself): ")
(what-text-to-set-as-motd-no . "Which text do you want as the new notice: ")
(conf-already-has-pres . "The conference/person already has a presentation. Continue anyway? ")
(conf-already-has-motd . "The conference/person already has a notice. Continue anyway? ")
(setting-conf-pres . "Setting presentation of %#1M to text %#2n...")
(setting-conf-motd . "Setting notice for %#1M to text %#2n...")
(who-to-remove-pres-for . "Vilket mte/person vill du ta bort presentationen frn (dig sjlv): ")
(removing-pres-for-conf . "Tar bort presentation (text %#2n) frn %#1M...")
(cant-get-conf-stat . "Cannot get the status of that conference.\n") (cant-get-conf-stat . "Cannot get the status of that conference.\n")
(go-to-conf-p . "Go to conference: ") (go-to-conf-p . "Go to conference: ")
(want-become-member . "Do you want to join? ") (want-become-member . "Do you want to join? ")
...@@ -1756,6 +1768,10 @@ You must become an active member of the conference to enter it.\n") ...@@ -1756,6 +1768,10 @@ You must become an active member of the conference to enter it.\n")
(kom-make-review-mark-as-read . "Review marks as read") (kom-make-review-mark-as-read . "Review marks as read")
(kom-make-review-not-mark-as-read . "Review does not mark as read") (kom-make-review-not-mark-as-read . "Review does not mark as read")
(kom-set-presentation . "Add presentation")
(kom-remove-presentation . "Remove presentation")
(kom-set-motd-text . "Add notice")
)) ))
(lyskom-language-var lyskom-language-codes en (lyskom-language-var lyskom-language-codes en
......
...@@ -303,6 +303,18 @@ du har l ...@@ -303,6 +303,18 @@ du har l
(what-to-change-faq-you . "Vilket mte vill du ndra FAQ fr: ") (what-to-change-faq-you . "Vilket mte vill du ndra FAQ fr: ")
(who-to-put-motd-for . "Vilket mte/person vill du stta lapp p drr fr (dig sjlv): ") (who-to-put-motd-for . "Vilket mte/person vill du stta lapp p drr fr (dig sjlv): ")
(what-to-set-pres-you . "Vilket mte/person vill du stta presentationen fr (dig sjlv): ")
(what-text-to-set-as-pres-no . "Vilket inlgg vill du ska vara den nya presentationen: ")
(what-to-set-motd-you . "Vilket mte/person vill du stta lapp p drr fr (dig sjlv): ")
(what-text-to-set-as-motd-no . "Vilket inlgg vill du ska vara den nya lappen: ")
(conf-already-has-pres . "Mtet/personen har redan en presentation. Fortstt nd? ")
(conf-already-has-motd . "Mtet/personen har redan en lapp p drren. Fortstt nd? ")
(setting-conf-pres . "Stter presentation fr %#1M till text %#2n...")
(setting-conf-motd . "Stter lapp p drren fr %#1M till text %#2n...")
(who-to-remove-pres-for . "Vilket mte/person vill du ta bort presentationen frn (dig sjlv): ")
(removing-pres-for-conf . "Tar bort presentation (text %#2n) frn %#1M...")
(cant-get-conf-stat . "Kan ej hmta mtesstatus fr mtet.\n") (cant-get-conf-stat . "Kan ej hmta mtesstatus fr mtet.\n")
(go-to-conf-p . "G till mte: ") (go-to-conf-p . "G till mte: ")
(want-become-member . "Vill du bli medlem? ") (want-become-member . "Vill du bli medlem? ")
...@@ -1755,6 +1767,10 @@ Du m ...@@ -1755,6 +1767,10 @@ Du m
(kom-make-review-mark-as-read . "terse lsmarkerar") (kom-make-review-mark-as-read . "terse lsmarkerar")
(kom-make-review-not-mark-as-read . "terse lsmarkerar inte") (kom-make-review-not-mark-as-read . "terse lsmarkerar inte")
(kom-set-presentation . "Addera presentation")
(kom-remove-presentation . "Ta bort presentation")
(kom-set-motd-text . "Addera lapp p drren")
)) ))
(lyskom-language-strings lyskom-help-strings sv (lyskom-language-strings lyskom-help-strings sv
......
...@@ -1200,7 +1200,8 @@ each time ." ...@@ -1200,7 +1200,8 @@ each time ."
(lyskom-button-view-pers-status-action . lyskom-button-view-pers-status) (lyskom-button-view-pers-status-action . lyskom-button-view-pers-status)
(lyskom-button-mail-action . lyskom-button-mail) (lyskom-button-mail-action . lyskom-button-mail)
(lyskom-button-send-message-action . lyskom-button-send-message)) (lyskom-button-send-message-action . lyskom-button-send-message))
nil) ((kom-list-news . lyskom-button-goto-conf)
(kom-membership . lyskom-button-goto-conf)))
(url (url
url-popup-title url-popup-title
lyskom-button-open-url lyskom-button-open-url
...@@ -1745,6 +1746,9 @@ is a list of vectors, where each vector specifies an item. ...@@ -1745,6 +1746,9 @@ is a list of vectors, where each vector specifies an item.
kom-make-review-mark-as-read kom-make-review-mark-as-read
kom-make-review-not-mark-as-read kom-make-review-not-mark-as-read
kom-set-presentation
kom-set-motd-text
kom-remove-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