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

Fixed bugs 591 (use call 107) and 859 (improved question in kom-status-conf)

Detailed changes:
> 	Fix bug 859:
> 	* swedish-strings.el,english-string.el (lyskom-messages): Fixed
> 	show-membership-info-q.
>
> 	Fix bug 591:
> 	* feature.el (read-ranges): New feature variable.
>
> 	* parse.el (lyskom-parse-membership-11): New function.
> 	(lyskom-convert-read-ranges-to-map): New function.
>
> 	* startup.el (lyskom-setup-client-for-server-version): Added
> 	features for protocol version 11.
>
> 	* utilities.el (lyskom-is-member): Pass want-read-ranges nil.
>
> 	* user-hooks.el (kom-read-last-text-hook): Pass want-read-ranges
> 	t.
>
> 	* prefetch.el (lyskom-prefetch-one-request): Pass want-read-ranges
> 	t.
>
> 	* mship-edit.el (lyskom-prioritize-flag-toggle): Pass
> 	want-read-ranges t.
>
> 	* lyskom-rest.el (lyskom-startup-check-recommended-memberships):
> 	Pass want-read-ranges nil.
> 	(lyskom-get-membership): Pass want-read-ranges t.
>
> 	* edit-text.el (lyskom-edit-send-check-recipients): Pass
> 	want-read-ranges nil.
>
> 	* commands2.el (kom-status-conf): Pass want-read-ranges t.
> 	(kom-set-unread): Ditto.
>
> 	* async.el (lyskom-parse-async): Pass want-read-ranges t.
>
> 	* commands1.el (lyskom-add-member-answer): Pass want-read-ranges
> 	t.
>
> 	* services.el (initiate-query-read-texts): Use call 107 when
> 	possible.
>
parent 7e75f4bf
2003-03-16 David Byers <david.byers@swipnet.se>
Fix bug 859:
* swedish-strings.el,english-string.el (lyskom-messages): Fixed
show-membership-info-q.
Fix bug 591:
* feature.el (read-ranges): New feature variable.
* parse.el (lyskom-parse-membership-11): New function.
(lyskom-convert-read-ranges-to-map): New function.
* startup.el (lyskom-setup-client-for-server-version): Added
features for protocol version 11.
* utilities.el (lyskom-is-member): Pass want-read-ranges nil.
* user-hooks.el (kom-read-last-text-hook): Pass want-read-ranges
t.
* prefetch.el (lyskom-prefetch-one-request): Pass want-read-ranges
t.
* mship-edit.el (lyskom-prioritize-flag-toggle): Pass
want-read-ranges t.
* lyskom-rest.el (lyskom-startup-check-recommended-memberships):
Pass want-read-ranges nil.
(lyskom-get-membership): Pass want-read-ranges t.
* edit-text.el (lyskom-edit-send-check-recipients): Pass
want-read-ranges nil.
* commands2.el (kom-status-conf): Pass want-read-ranges t.
(kom-set-unread): Ditto.
* async.el (lyskom-parse-async): Pass want-read-ranges t.
* commands1.el (lyskom-add-member-answer): Pass want-read-ranges
t.
* services.el (initiate-query-read-texts): Use call 107 when
possible.
Fix bug 946:
* commands2.el (lyskom-print-summary-line): Can print the number
of comments to a text.
......
......@@ -266,7 +266,7 @@ this function shall be with current-buffer the BUFFER."
(when (eq pers-no lyskom-pers-no)
(lyskom-collect 'follow)
(initiate-get-conf-stat 'follow nil conf-no)
(initiate-query-read-texts 'follow nil pers-no conf-no)
(initiate-query-read-texts 'follow nil pers-no conf-no t 0)
(lyskom-use 'follow 'lyskom-async-new-membership pers-no conf-no))
))))
......
......@@ -784,7 +784,8 @@ If optional USE-PRIORITY is non-nil then use that as the priority.
lyskom-pers-no)
(let ((mship (blocking-do 'query-read-texts
lyskom-pers-no
(conf-stat->conf-no conf-conf-stat))))
(conf-stat->conf-no conf-conf-stat)
t 0)))
(unless (membership->position mship)
(set-membership->position mship pos))
(lyskom-add-membership mship
......
......@@ -318,7 +318,9 @@ otherwise: the conference is read with lyskom-completing-read."
(let ((membership (blocking-do
'query-read-texts
(member->pers-no member)
(conf-stat->conf-no conf-stat))))
(conf-stat->conf-no conf-stat)
t
0)))
;; Print a row describing the membership of MEMBER
;; (described by MEMBERSHIP) in CONF-STAT.
(if (or (null membership))
......@@ -801,7 +803,7 @@ send. If DONTSHOW is non-nil, don't display the sent message."
((numberp n)
(lyskom-format-insert 'set-unread-n n)
(blocking-do 'set-unread conf-no n)))
(setq membership (blocking-do 'query-read-texts lyskom-pers-no conf-no))
(setq membership (blocking-do 'query-read-texts lyskom-pers-no conf-no t 0))
(lyskom-replace-membership membership)
(if (= conf-no lyskom-current-conf)
(set-read-list-empty lyskom-reading-list))
......
......@@ -954,6 +954,8 @@ Cannot be called from a callback."
(collector-push x y))
(conf-stat->conf-no author)
recipient
nil
0
memberships))
(lyskom-wait-queue 'sending)
(setq memberships (collector->value memberships))
......
......@@ -628,7 +628,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(Everybody . "Everyone")
(show-members-list-also-q . "List members? ")
(show-membership-info-q . "Show number of unreads? ")
(show-membership-info-q . "Show membership info number of unreads? ")
(conf-has-these-members . "\n%#1M has the following members:\n")
(conf-has-no-members . "\n%#1M has no members.\n")
(member-list-header . "\nLast entered Unread Name\n")
......@@ -2360,6 +2360,7 @@ environment to one that uses \"%#2s\" to encode text.
;; These should be first in order to be last in the menu of alternatives.
(define-key lyskom-en-review-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-en-unread-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-en-change-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-en-next-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-en-list-prefix (kbd "?") 'lyskom-help)
......
......@@ -96,6 +96,7 @@
;;; The features
(lyskom-define-feature bcc-misc nil)
(lyskom-define-feature read-ranges nil)
(lyskom-define-feature aux-items nil)
(lyskom-define-feature highest-call 0)
(lyskom-define-feature local-to-global nil)
......
......@@ -781,6 +781,7 @@ by PERS-NO"
'collector-push
lyskom-pers-no
(car rec)
nil 0
collector))
(lyskom-wait-queue 'main)
......@@ -1020,7 +1021,7 @@ found in lyskom-membership, a blocking call to the server is made."
(or (lyskom-try-get-membership conf-no want-passive)
(and (not (lyskom-membership-is-read))
(let ((membership
(blocking-do 'query-read-texts lyskom-pers-no conf-no)))
(blocking-do 'query-read-texts lyskom-pers-no conf-no t 0)))
(if (and membership (lyskom-visible-membership membership))
(lyskom-add-membership membership conf-no))
(if (and membership
......
......@@ -796,7 +796,8 @@ clicked on."
(let ((mship
(blocking-do 'query-read-texts
lyskom-pers-no
(membership->conf-no (lp--entry->membership entry)))))
(membership->conf-no (lp--entry->membership entry))
t 0)))
(lyskom-replace-membership mship)
(set-lp--entry->membership entry mship)
(when (eq flag 'passive)
......
......@@ -623,6 +623,37 @@ than 0. Args: ITEMS-TO-PARSE PRE-FETCHED. Returns -1 if ITEMS-TO-PARSE is
(lyskom-parse-vector (lyskom-parse-num)
'lyskom-parse-member)))
(defun lyskom-convert-read-ranges-to-map (read-ranges)
(let ((result nil)
a b)
(while read-ranges
(setq a (car (car read-ranges))
b (cdr (car read-ranges))
read-ranges (cdr read-ranges))
(while (<= a b) (setq result (cons a result) a (1+ a))))
(and result (apply 'vector (nreverse result)))))
(defun lyskom-parse-membership-11 ()
"Parse a membership, converting read-ranges to the old style."
(let ((read-ranges nil))
(lyskom-create-membership
(lyskom-parse-num) ;position
(lyskom-parse-time) ;last-time-read
(lyskom-parse-num) ;conf-no
(lyskom-parse-num) ;priority
(progn (setq read-ranges
(listify-vector
(lyskom-parse-vector
(lyskom-parse-num) 'lyskom-parse-read-range)))
(if (eq (car (car read-ranges)) 1)
(prog1 (cdr (elt read-ranges 0))
(setq read-ranges (cdr read-ranges)))
0))
(lyskom-convert-read-ranges-to-map read-ranges)
(lyskom-parse-num) ;added-by
(lyskom-parse-time) ;added-at
(lyskom-parse-membership-type))))
(defun lyskom-parse-membership ()
"Parse a membership."
(lyskom-create-membership
......@@ -1032,6 +1063,10 @@ Args: TEXT-NO. Value: text-stat."
"Parse a Text-Number-Pair"
(lyskom-create-text-pair (lyskom-parse-num) (lyskom-parse-num)))
(defun lyskom-parse-read-range ()
"Parse a Read-Range"
(lyskom-create-text-pair (lyskom-parse-num) (lyskom-parse-num)))
;;; ================================================================
;;; Parsing of complex datatypes without cache.
......
......@@ -571,6 +571,7 @@ Return t if an element was prefetched, otherwise return nil."
'lyskom-prefetch-read-texts-handler
(elt request 2)
(elt request 1)
t 0
(elt request 1)
queue))
......
......@@ -193,18 +193,31 @@ Args: KOM-QUEUE HANDLER PERS-NO OLD-PW NEW-PW &rest DATA."
;;; by another call.
;;;
(defun initiate-query-read-texts (kom-queue handler
pers-no conf-no &rest data)
pers-no
conf-no
want-read-ranges
max-ranges
&rest data)
"Get a membership struct describing the membership of PERS-NO in CONF-NO.
Args: KOM-QUEUE HANDLER PERS-NO CONF-NO &rest DATA"
(lyskom-server-call
(lyskom-call kom-queue lyskom-ref-no handler data
(if (lyskom-have-call 98)
'lyskom-parse-membership
'lyskom-parse-membership-old))
(lyskom-send-packet kom-queue
(lyskom-format-objects
(if (lyskom-have-call 98) 98 9)
pers-no conf-no))))
(cond ((lyskom-have-call 107)
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-11)
(lyskom-send-packet kom-queue
(lyskom-format-objects 107 pers-no conf-no
want-read-ranges
max-ranges)))
((lyskom-have-call 98)
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership)
(lyskom-send-packet kom-queue
(lyskom-format-objects 98 pers-no conf-no)))
(t
(lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-old)
(lyskom-send-packet kom-queue
(lyskom-format-objects 9 pers-no conf-no))))))
(defun initiate-create-conf (kom-queue handler
......
......@@ -474,18 +474,23 @@ clients of the event. See lyskom-mode for details on lyskom."
(let ((protocol-version
(version-info->protocol-version lyskom-server-version-info)))
(when (>= protocol-version 8)
(lyskom-set-feature long-conf-types t))
(when (>= protocol-version 9)
(lyskom-set-feature dynamic-session-info t)
(lyskom-set-feature idle-time t))
(when (>= protocol-version 10)
(lyskom-set-feature bcc-misc t)
(lyskom-set-feature aux-items t)
(lyskom-set-feature highest-call 105)
(lyskom-set-feature local-to-global t))
(when (>= protocol-version 9)
(lyskom-set-feature dynamic-session-info t)
(lyskom-set-feature idle-time t))
(when (>= protocol-version 8)
(lyskom-set-feature long-conf-types t))))
(when (>= protocol-version 11)
(lyskom-set-feature read-ranges t)
(lyskom-set-feature highest-call 110))
))
(defun lyskom-connect-filter (proc output)
......
......@@ -634,7 +634,7 @@ i svensk datorhistoria. L
(Everybody . "Alla")
(show-members-list-also-q . "Vill du se medlemslistan ocks? ")
(show-membership-info-q . "Visa antalet olsta? ")
(show-membership-info-q . "Visa medlemskapsinformation och antalet olsta? ")
(conf-has-these-members . "\n%#1M har fljande medlemmar:\n")
(conf-has-no-members . "\n%#1M har inga medlemmar.\n")
(member-list-header . "\nSenast inne Osett Namn\n")
......@@ -2424,6 +2424,7 @@ teckenkodning.
;; These should be first in order to be last in the menu of alternatives.
(define-key lyskom-sv-change-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-sv-review-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-sv-unread-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-sv-filter-get-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-sv-next-prefix (kbd "?") 'lyskom-help)
(define-key lyskom-sv-list-prefix (kbd "?") 'lyskom-help)
......
......@@ -78,7 +78,7 @@ Not that even unread texts may be read again when usign this function."
(arg (and spec (if (consp spec) (cdr spec) 1))))
(when (and arg (blocking-do 'set-unread to-conf arg))
(let ((membership (blocking-do 'query-read-texts lyskom-pers-no
to-conf))
to-conf t 0))
(read-info nil))
(lyskom-replace-membership membership)
(read-list-delete-read-info to-conf lyskom-to-do-list)
......
......@@ -1329,6 +1329,7 @@ Cannot be called from a callback."
'collector-push
pers-no
conf-no
nil 0
collector)
(lyskom-wait-queue (or queue 'background))
(car (collector->value collector)))))
......
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