Commit 8356ba80 authored by David Byers's avatar David Byers
Browse files

Wrote code to clean up read FAQs on login

parent 178221e8
2002-08-12 David Byers <david.byers@swipnet.se>
* startup.el (lyskom-refetch): Call lyskom-clean-read-faqs.
* lyskom-rest.el (lyskom-startup-clean-read-faqs): New function.
(lyskom-startup-clean-read-faqs-1): New function.
2002-08-09 David Byers <david.byers@swipnet.se> 2002-08-09 David Byers <david.byers@swipnet.se>
Better font handling: Better font handling:
......
...@@ -760,6 +760,37 @@ by PERS-NO" ...@@ -760,6 +760,37 @@ by PERS-NO"
pers-conf-stat)) pers-conf-stat))
(lyskom-reject-recommendation (elt rec 0))))))))) (lyskom-reject-recommendation (elt rec 0)))))))))
(defun lyskom-clean-read-faqs (pers-no)
"Remove all read-faq aux-items from PERS-NO that correspond to texts
that are no longer FAQs or are missing."
(let ((conf-stat (blocking-do 'get-conf-stat pers-no)))
(when conf-stat
(lyskom-traverse item (lyskom-get-aux-item (conf-stat->aux-items conf-stat)
10000)
(when (string-match "^\\([0-9]+\\) \\([0-9]+\\)" (aux-item->data item))
(let ((conf-no (string-to-int (match-string 1 (aux-item->data item))))
(text-no (string-to-int (match-string 2 (aux-item->data item)))))
(initiate-get-text-stat 'background
'lyskom-clean-read-faqs-1
text-no
pers-no
conf-no
item)))))))
(defun lyskom-clean-read-faqs-1 (text-stat pers-no conf-no item)
"Callback for lyskom-clean-read-faqs"
(let ((cmp (int-to-string conf-no)))
(when (or (null text-stat)
(lyskom-traverse aux (lyskom-get-aux-item
(text-stat->aux-items text-stat)
28)
(when (string= cmp (aux-item->data aux))
(lyskom-traverse-break t))))
(initiate-modify-conf-info 'background
nil
pers-no
(list (aux-item->aux-no item))
nil))))
(defun lyskom-enter-conf (conf-stat read-info) (defun lyskom-enter-conf (conf-stat read-info)
......
...@@ -676,6 +676,7 @@ This is called at login and after prioritize and set-unread." ...@@ -676,6 +676,7 @@ This is called at login and after prioritize and set-unread."
(condition-case nil (condition-case nil
(progn (lyskom-update-read-faqs) (progn (lyskom-update-read-faqs)
(lyskom-clean-read-faqs lyskom-pers-no)
(lyskom-update-rejected-recommendations) (lyskom-update-rejected-recommendations)
(lyskom-startup-check-faqs) (lyskom-startup-check-faqs)
(lyskom-startup-check-recommended-memberships)) (lyskom-startup-check-recommended-memberships))
......
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