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

Fixed bug 1250. I hope.

Detailed changes:
> 2004-02-21  David Byers  <byers@lysator.liu.se>
>
> 	Fix bug 1250:
> 	* view-text.el (lyskom-text-read-at-least-once-p): Don't consider
> 	passive memberships.
> 	(lyskom-text-read-p): Same here.
>
> 	* services.el (initiate-get-part-of-membership): Don't get read texts.
>
> 	* lyskom-rest.el (lyskom-get-read-texts-for-membership): New
> 	function.
>
> 	* commands2.el (kom-is-person-member-of-conference): Use it here.
>
parent 57b0f861
2004-02-21 David Byers <byers@lysator.liu.se>
Fix bug 1250:
* view-text.el (lyskom-text-read-at-least-once-p): Don't consider
passive memberships.
(lyskom-text-read-p): Same here.
* services.el (initiate-get-part-of-membership): Don't get read texts.
* lyskom-rest.el (lyskom-get-read-texts-for-membership): New
function.
* commands2.el (kom-is-person-member-of-conference): Use it here.
2004-02-12 David Byers <byers@lysator.liu.se> 2004-02-12 David Byers <byers@lysator.liu.se>
Make kom-list-new-conferences quittable: Make kom-list-new-conferences quittable:
......
...@@ -336,6 +336,7 @@ otherwise: the conference is read with lyskom-completing-read." ...@@ -336,6 +336,7 @@ otherwise: the conference is read with lyskom-completing-read."
(lyskom-format-time (lyskom-format-time
'date-and-time 'date-and-time
(membership->last-time-read membership))) (membership->last-time-read membership)))
(let ((unread (- (+ (conf-stat->first-local-no (let ((unread (- (+ (conf-stat->first-local-no
conf-stat) conf-stat)
(conf-stat->no-of-texts conf-stat)) (conf-stat->no-of-texts conf-stat))
...@@ -558,6 +559,7 @@ This command accepts text number prefix arguments \(see ...@@ -558,6 +559,7 @@ This command accepts text number prefix arguments \(see
member-conf-stat) member-conf-stat)
(conf-stat->no-of-texts (conf-stat->no-of-texts
member-conf-stat)) member-conf-stat))
(membership->last-text-read membership) (membership->last-text-read membership)
(length (membership->read-texts (length (membership->read-texts
membership)) membership))
...@@ -2687,6 +2689,7 @@ See `kom-keep-alive' for more information." ...@@ -2687,6 +2689,7 @@ See `kom-keep-alive' for more information."
(lyskom-replace-deferred (lyskom-replace-deferred
defer-info (lyskom-get-string 'Unknown-number)) defer-info (lyskom-get-string 'Unknown-number))
(let ((conf-stat (defer-info->data defer-info))) (let ((conf-stat (defer-info->data defer-info)))
(lyskom-get-read-texts-for-membership (or pers-no lyskom-pers-no) membership)
(lyskom-replace-deferred defer-info (lyskom-replace-deferred defer-info
(number-to-string (number-to-string
(- (+ (conf-stat->first-local-no conf-stat) (- (+ (conf-stat->first-local-no conf-stat)
......
...@@ -552,11 +552,11 @@ lyskom-mark-as-read." ...@@ -552,11 +552,11 @@ lyskom-mark-as-read."
(if (memq (misc-info->type misc) '(RECPT BCC-RECPT CC-RECPT)) (if (memq (misc-info->type misc) '(RECPT BCC-RECPT CC-RECPT))
(let ((membership (lyskom-try-get-membership (let ((membership (lyskom-try-get-membership
(misc-info->recipient-no misc)))) (misc-info->recipient-no misc))))
(if membership (when membership
(set-membership->read-texts (set-membership->read-texts
membership membership
(vconcat (vector (misc-info->local-no misc)) (vconcat (vector (misc-info->local-no misc))
(membership->read-texts membership)))))))) (membership->read-texts membership))))))))
;;; ================================================================ ;;; ================================================================
...@@ -1044,6 +1044,24 @@ found in lyskom-membership, a blocking call to the server is made." ...@@ -1044,6 +1044,24 @@ found in lyskom-membership, a blocking call to the server is made."
nil)))))) nil))))))
(defun lyskom-get-read-texts-for-membership (pers-no mship)
"Get read-texts for membership MSHIP"
(when (and mship (null (membership->read-texts mship)))
(let ((result (make-collector)))
(initiate-query-read-texts 'read-texts
'collector-push
pers-no
(membership->conf-no mship)
t
lyskom-max-int
result)
(lyskom-wait-queue 'read-texts)
(when (car (collector->value result))
(set-membership->read-texts
mship
(or (membership->read-texts (car (collector->value result)))
(make-vector 0 nil)))))))
;;;; ================================================================ ;;;; ================================================================
;;;; Scrolling and text insertion. ;;;; Scrolling and text insertion.
......
...@@ -586,7 +586,8 @@ Return t if an element was prefetched, otherwise return nil." ...@@ -586,7 +586,8 @@ Return t if an element was prefetched, otherwise return nil."
'lyskom-prefetch-read-texts-handler 'lyskom-prefetch-read-texts-handler
(elt request 2) (elt request 2)
(elt request 1) (elt request 1)
t 0 t
0
(elt request 1) (elt request 1)
queue)) queue))
...@@ -595,7 +596,8 @@ Return t if an element was prefetched, otherwise return nil." ...@@ -595,7 +596,8 @@ Return t if an element was prefetched, otherwise return nil."
(initiate-get-part-of-membership (initiate-get-part-of-membership
'prefetch 'lyskom-prefetch-membership-handler 'prefetch 'lyskom-prefetch-membership-handler
(cdr request) (cdr request)
lyskom-membership-is-read lyskom-fetch-membership-length lyskom-membership-is-read
lyskom-fetch-membership-length
(cdr request) (cdr request)
queue) queue)
; We are done ; We are done
......
...@@ -716,18 +716,18 @@ Args: KOM-QUEUE HANDLER PERS-NO FIRST-IN-LIST LENGHT &rest DATA." ...@@ -716,18 +716,18 @@ Args: KOM-QUEUE HANDLER PERS-NO FIRST-IN-LIST LENGHT &rest DATA."
(lyskom-send-packet (lyskom-send-packet
kom-queue kom-queue
(lyskom-format-objects 108 pers-no first length (lyskom-format-objects 108 pers-no first length
1 lyskom-max-int))) 0 0)))
((lyskom-have-call 99) ((lyskom-have-call 99)
(lyskom-call kom-queue lyskom-ref-no handler data (lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-list) 'lyskom-parse-membership-list)
(lyskom-send-packet (lyskom-send-packet
kom-queue kom-queue
(lyskom-format-objects 99 pers-no first length 1))) (lyskom-format-objects 99 pers-no first length 0)))
(t (lyskom-call kom-queue lyskom-ref-no handler data (t (lyskom-call kom-queue lyskom-ref-no handler data
'lyskom-parse-membership-list-old) 'lyskom-parse-membership-list-old)
(lyskom-send-packet (lyskom-send-packet
kom-queue kom-queue
(lyskom-format-objects 46 pers-no first length 1)))))) (lyskom-format-objects 46 pers-no first length 0))))))
(defun initiate-get-created-texts (kom-queue handler pers-no first-local (defun initiate-get-created-texts (kom-queue handler pers-no first-local
......
...@@ -582,13 +582,12 @@ recipients to it that the user is a member in." ...@@ -582,13 +582,12 @@ recipients to it that the user is a member in."
;; Is this function ever called asynchronously? If not, we ;; Is this function ever called asynchronously? If not, we
;; can use lyskom-get-membership istead. ;; can use lyskom-get-membership istead.
(let ((membership (lyskom-try-get-membership (let ((membership (lyskom-try-get-membership
(misc-info->recipient-no misc-info) t)) (misc-info->recipient-no misc-info) nil))
(loc-no (misc-info->local-no misc-info))) (loc-no (misc-info->local-no misc-info)))
;; Make a note that this text really is in a group we are ;; Make a note that this text really is in a group we are
;; a member of. ;; a member of.
(if (and res membership) (setq res t)) (if (and res membership) (setq res t))
(if (and membership (if (and membership
(> loc-no (membership->last-text-read membership)) (> loc-no (membership->last-text-read membership))
(not (lyskom-vmemq loc-no (not (lyskom-vmemq loc-no
...@@ -621,7 +620,8 @@ blocking-do." ...@@ -621,7 +620,8 @@ blocking-do."
(lyskom-try-get-membership (lyskom-try-get-membership
(misc-info->recipient-no misc-item) t) (misc-info->recipient-no misc-item) t)
(lyskom-get-membership (lyskom-get-membership
(misc-info->recipient-no misc-item) t))) (misc-info->recipient-no misc-item) nil)))
(when membership (when membership
(setq is-member t) (setq is-member t)
(when (or (<= (misc-info->local-no misc-item) (when (or (<= (misc-info->local-no misc-item)
......
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