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

Added command to create arbitrary aux-items

Display all aux-items on status conf
parent e9e74ede
2002-04-10 David Byers <david.byers@swipnet.se>
Implementera kommando för att skapa godtyckliga aux-items:
* commands2.el (kom-status-conf): Visa okända aux-items.
(kom-create-aux-item): Nytt kommando
* lyskom-buttons.el (lyskom-button-info-aux): Print info even if
there is no info handler for the aux-item type (required to handle
unknown types).
* lyskom-rest.el (lyskom-check-go-to-conf): When we don't want to
accept an invitation, don't make the membership *passive*. That
causes all kinds of odd messages.
......
......@@ -265,7 +265,15 @@ otherwise: the conference is read with lyskom-completing-read."
(lyskom-traverse-aux item
(conf-stat->aux-items conf-stat)
(lyskom-aux-item-call item 'status-print item conf-stat))
(if (lyskom-aux-item-definition-field item 'status-print)
(lyskom-aux-item-call item 'status-print item conf-stat)
(lyskom-format-insert 'status-aux-item
(format "%d/%d"
(aux-item->aux-no item)
(aux-item->tag item))
(aux-item->creator item)
(lyskom-aux-item-terminating-button item conf-stat))
))
(let ((mship (lyskom-try-get-membership (conf-stat->conf-no conf-stat) t)))
(when mship
......@@ -2620,3 +2628,54 @@ to the first text that NEW is a comment or footnote to."
(ediff-buffers
(lyskom-create-text-buffer old old-text old-text-stat)
(lyskom-create-text-buffer new new-text new-text-stat))))
;;; ================================================================
;;; Skapa aux-item
(def-kom-command kom-create-aux-item ()
"Create arbitrary aux-items"
(interactive)
(let* ((completions
(mapcar (lambda (x) (cons (lyskom-get-string x) x))
'(server conference text)))
(completion-ignore-case t)
(object-type
(cdr (lyskom-string-assoc
(lyskom-completing-read 'what-kind-to-add-aux-to
completions
nil t)
completions)))
(object-id (cond ((eq object-type 'server) nil)
((eq object-type 'conference)
(lyskom-read-conf-no 'which-conf-to-add-aux-to '(pers conf)))
((eq object-type 'text)
(lyskom-read-number 'which-text-to-add-aux-to
(if (and lyskom-current-text
(not (zerop lyskom-current-text)))
lyskom-current-text
nil)))))
(tag (lyskom-read-number 'which-aux-item-tag))
(inherit (lyskom-j-or-n-p 'which-aux-item-inherit))
(secret (lyskom-j-or-n-p 'which-aux-item-secret))
(anonymous (lyskom-j-or-n-p 'which-aux-item-anonymous))
(rsv1 (lyskom-j-or-n-p 'which-aux-item-rsv1))
(rsv2 (lyskom-j-or-n-p 'which-aux-item-rsv2))
(rsv3 (lyskom-j-or-n-p 'which-aux-item-rsv3))
(rsv4 (lyskom-j-or-n-p 'which-aux-item-rsv4))
(inherit-limit (lyskom-read-number 'which-aux-item-inherit-limit))
(data (lyskom-read-string 'which-aux-item-data))
(flags (lyskom-create-aux-item-flags nil inherit secret anonymous
rsv1 rsv2 rsv3 rsv4))
(item (lyskom-create-aux-item 0 tag 0 0 flags inherit-limit data)))
(lyskom-report-command-answer
(cond ((eq object-type 'server)
(blocking-do 'modify-server-info nil (list item)))
((eq object-type 'conference)
(progn (cache-del-conf-stat object-id)
(blocking-do 'modify-conf-info object-id nil (list item))))
((eq object-type 'text)
(progn (cache-del-text-stat object-id)
(blocking-do 'modify-text-info object-id nil (list item))))))
(when (eq object-type 'server)
(setq lyskom-server-info (blocking-do 'get-server-info)))))
......@@ -596,6 +596,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(conf-has-motd . "\n%#1M has a notice on his/her mailbox:\n")
(conf-mship-priority . "Prioritet: %25#1n%#2?b%[ %#2s%]%[%]\n")
(status-conf-generic . "%-40#1s %#2s\n")
(status-aux-item . "Extra information: %15#1s%#3s (skapad av %#2M)\n")
(Everybody . "Everyone")
(show-members-list-also-q . "List members? ")
......@@ -1468,11 +1469,26 @@ Contents: \"%#9s\"
(default-agree-string . "I agree")
(what-agree-no . "Agree with which text? ")
(what-kind-to-add-aux-to . "Attach information to what? ")
(which-conf-to-add-aux-to . "Which conference to you want to attach information to? ")
(which-text-to-add-aux-to . "Which article to you want to attach information to? ")
(which-aux-item-tag . "Information tag: ")
(which-aux-item-inherit . "Set the inherit-flag? ")
(which-aux-item-secret . "Set the secret-flag? ")
(which-aux-item-anonymous . "Set the anonymous-flag? ")
(which-aux-item-rsv1 . "Set the reserved1-flag? ")
(which-aux-item-rsv2 . "Set the reserved2-flag? ")
(which-aux-item-rsv3 . "Set the reserved3-flag? ")
(which-aux-item-rsv4 . "Set the reserved4-flag? ")
(which-aux-item-inherit-limit . "Inherit limit: ")
(which-aux-item-data . "Data: ")
;; Cross-reference stuff
(person . "User")
(conference . "Conference")
(text . "Text")
(server . "Server")
(xref-type . "What to you want to refer to (text, conference or person)? ")
(which-text-to-xref . "Add reference to text: ")
......
......@@ -1210,23 +1210,20 @@ depending on the value of `kom-lynx-terminal'."
(setq items (cdr items))))))
(if aux
(progn
(lyskom-start-of-command nil)
(unwind-protect
(let ((data (lyskom-aux-item-call
aux
'info
aux
(cond ((eq 'text (car arg))
(let ((header (cond ((eq 'text (car arg))
(lyskom-format 'text-no (elt arg 1)))
((eq 'conf (car arg))
(lyskom-format 'conference-no
(blocking-do 'get-conf-stat
(elt arg 1))))
(t "????")))))
(if data
(lyskom-insert data)
(lyskom-format-insert 'aux-item-no-info)))
(t "????"))))
(lyskom-start-of-command nil)
(unwind-protect
(lyskom-insert (or (lyskom-aux-item-call aux
'info
aux
header)
(lyskom-aux-item-info aux header)))
(lyskom-end-of-command)))
(lyskom-format-insert 'cant-get-aux-item))))
......
......@@ -576,6 +576,7 @@ i svensk datorhistoria. L
(conf-mship-priority . "Prioritet: %25#1n%#2?b%[ %#2s%]%[%]\n")
(conf-has-motd . "\n%#1M har en lapp p drren:\n")
(status-conf-generic . "%-40#1s %#2s\n")
(status-aux-item . "Tillggsinformation: %15#1s%#3s (skapad av %#2M)\n")
(Everybody . "Alla")
(show-members-list-also-q . "Vill du se medlemslistan ocks? ")
......@@ -1466,11 +1467,26 @@ Inneh
(default-agree-string . "Hller med")
(what-agree-no . "Hll med vilket inlgg? ")
(what-kind-to-add-aux-to . "Koppla tillggsinformation till vad? ")
(which-conf-to-add-aux-to . "Vilket mte vill du koppla till? ")
(which-text-to-add-aux-to . "Vilket inlgg vill du koppla till? ")
(which-aux-item-tag . "Aux-item tag: ")
(which-aux-item-inherit . "Stt inherit-flaggan? ")
(which-aux-item-secret . "Stt secret-flaggan? ")
(which-aux-item-anonymous . "Stt anonymous-flaggan? ")
(which-aux-item-rsv1 . "Stt reserved1-flaggan? ")
(which-aux-item-rsv2 . "Stt reserved2-flaggan? ")
(which-aux-item-rsv3 . "Stt reserved3-flaggan? ")
(which-aux-item-rsv4 . "Stt reserved4-flaggan? ")
(which-aux-item-inherit-limit . "Arvsgrns: ")
(which-aux-item-data . "Data: ")
;; Cross-reference stuff
(person . "Person")
(conference . "Mte")
(text . "Inlgg")
(server . "Server")
(xref-type . "Vad vill du referera till (inlgg, mte eller person)? ")
(which-text-to-xref . "Lgg till referens till text nummer: ")
......
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