Commit 8e88b8fd authored by David Byers's avatar David Byers

Fixed bugs 1660, 1658. Added support for adding sender regexp import filter.

Detailed changes:
> 2008-05-11    <David Byers@GULAG>
>
> 	Fix bug 1660:
> 	* edit-text.el (lyskom-create-text-handler): Added callback and
> 	callback-data parameters. Juggling buffers to get these right is
> 	somewhat tricky, but worst is that it is *possible* for the buffer
> 	containing the callback to be deleted before this is called.
> 	(lyskom-edit-send): Pass lyskom-edit-handler and data to
> 	lyskom-create-text-handler.
>
> 	Fix bug 1658:
> 	* review.el (kom-review-rot13): Removed local arg from add-hook.
>
> 	* commands2.el (kom-limit-import): Add support for limiting import
> 	by regexp.
>
parent 64582b17
2008-05-11 <David Byers@GULAG>
Fix bug 1660:
* edit-text.el (lyskom-create-text-handler): Added callback and
callback-data parameters. Juggling buffers to get these right is
somewhat tricky, but worst is that it is *possible* for the buffer
containing the callback to be deleted before this is called.
(lyskom-edit-send): Pass lyskom-edit-handler and data to
lyskom-create-text-handler.
Fix bug 1658:
* review.el (kom-review-rot13): Removed local arg from add-hook.
* commands2.el (kom-limit-import): Add support for limiting import
by regexp.
2008-03-17 Per Cederqvist <ceder@ingate.com>
Make it configurable if the client should search for unread
......
......@@ -147,10 +147,21 @@ returns non-nil, no more actions will be applied.")
(lyskom-create-defer-info
'user-active
nil
(lambda (res defer-info)
(lambda (res par defer-info)
(if res
(lyskom-replace-deferred defer-info "klart")
(lyskom-replace-deferred defer-info "det gick inte")))
nil nil "%#1s"))))))
; (setq kom-auto-organize-list '((3715 (7871 ("See attachment" . kom-auto-organize-sub-recipient)))))
;; (setq kom-auto-organize-list
;; '((3715
;; (7871 ("See attachment" . kom-auto-organize-sub-recipient)))))
;;
;; (setq kom-auto-organize-list
;; '((t
;; (119
;; ("see attachment" . kom-auto-organize-debug)
;; ("oem software means" . kom-auto-organize-sub-recipient)
;; ("beware of fake pills" . kom-auto-organize-debug)
;; )
;; )))
......@@ -363,6 +363,12 @@ Invalid tests are silently ignored."
(def-aux-item elisp-client-enriched-headers 10002)
(def-aux-item mx-allow-envelope-sender-regexp 10105
(text-name aux-mx-allow-envelope-sender-regexp)
(info . lyskom-aux-item-info)
(status-print . lyskom-print-mx-allow-envelope-sender-regexp))
;;; ================================================================
......@@ -782,4 +788,10 @@ Invalid tests are silently ignored."
`(face ,kom-warning-face)
(lyskom-aux-item-terminating-button item obj))))
(defun lyskom-print-mx-allow-envelope-sender-regexp (item &optional obj)
(lyskom-format-insert 'conf-mx-allow-envelope-sender-regexp
(aux-item->data item)
(lyskom-aux-item-terminating-button item obj)))
(provide 'lyskom-aux-items)
......@@ -3299,7 +3299,7 @@ are advisory; clients may ignore them."
'(conf pers) nil nil t)))
(when conf-stat
(let* ((what (lyskom-a-or-b-or-c-p 'limit-import-of-what
'(abc-spam abc-html abc-everything)
'(abc-regexp abc-spam abc-html abc-everything)
'abc-spam))
(data (cond ((eq what 'abc-spam) "spam")
((eq what 'abc-html) "html")
......@@ -3307,8 +3307,9 @@ are advisory; clients may ignore them."
(when (or (lyskom-is-supervisor (conf-stat->conf-no conf-stat)
lyskom-pers-no)
(lyskom-j-or-n-p 'limit-import-not-super))
(when data
(lyskom-format-insert 'limiting-import
(cond
((and data (memq what '(abc-spam abc-html abc-everything)))
(lyskom-format-insert 'limiting-import
(substring (lyskom-get-string what) 1)
conf-stat)
(lyskom-report-command-answer
......@@ -3321,7 +3322,25 @@ are advisory; clients may ignore them."
(lyskom-create-aux-item-flags nil nil nil nil
nil nil nil nil)
0 data))))
(cache-del-conf-stat (conf-stat->conf-no conf-stat)))))))
(cache-del-conf-stat (conf-stat->conf-no conf-stat)))
((eq what 'abc-regexp)
(let ((regexp (lyskom-read-string
(lyskom-get-string 'limit-import-regexp-q)
nil nil)))
(lyskom-format-insert 'limiting-import-regexp
regexp
conf-stat)
(lyskom-report-command-answer
(blocking-do 'modify-conf-info
(conf-stat->conf-no conf-stat)
nil
(list
(lyskom-create-aux-item
0 10105 nil nil
(lyskom-create-aux-item-flags nil nil nil nil
nil nil nil nil)
0 regexp))))
(cache-del-conf-stat (conf-stat->conf-no conf-stat)))))))))
(def-kom-command kom-change-message-flag (uconf-stat)
......
......@@ -474,6 +474,8 @@ This runs `kom-send-text-hook' and (for backwards compatibility)
(j-or-n-p (lyskom-get-string 'already-sent)))
(progn
(let ((buffer (current-buffer))
(handler lyskom-edit-handler)
(handler-data lyskom-edit-handler-data)
(headers nil)
(misc-list nil)
(subject nil)
......@@ -632,7 +634,9 @@ This runs `kom-send-text-hook' and (for backwards compatibility)
aux-list)
aux-list)
buffer
is-anonymous))))
is-anonymous
handler
handler-data))))
(lyskom-undisplay-buffer)
(goto-char (point-max))))
;;
......@@ -1685,8 +1689,8 @@ Point must be located on the line where the subject is."
(point))))))
(defun lyskom-create-text-handler (text-no edit-buffer
&optional is-anonymous)
(defun lyskom-create-text-handler (text-no edit-buffer is-anonymous
callback callback-data)
"Handle an attempt to write a text."
(lyskom-tell-internat 'kom-tell-silence)
(message "")
......@@ -1754,18 +1758,16 @@ Point must be located on the line where the subject is."
;; Select the old configuration.
(let ((hnd lyskom-edit-handler)
(dta lyskom-edit-handler-data))
(when (get-buffer-window edit-buffer)
(set-window-configuration lyskom-edit-return-to-configuration)
(set-buffer (window-buffer (selected-window)))
(goto-char (point-max)))
;; Apply handler.
(lyskom-save-excursion
(set-buffer lyskom-buffer)
(if hnd (apply hnd text-no dta))))
(when (get-buffer-window edit-buffer)
(set-window-configuration lyskom-edit-return-to-configuration)
(set-buffer (window-buffer (selected-window)))
(goto-char (point-max)))
;; Apply handler.
(lyskom-save-excursion
(set-buffer lyskom-buffer)
(if callback (apply callback text-no callback-data)))
;; Kill the edit-buffer.
......
......@@ -715,6 +715,7 @@ Read all about it at http://www.lysator.liu.se/history/")
(conf-mship-priority . "Prioritet: %25#1n%#2?b%[ %#2s%]%[%]\n")
(status-conf-generic . "%-40#1s %#2s\n")
(status-aux-item . "Unknown property: %11#1s%#3s (created by %#2M)\n")
(conf-mx-allow-envelope-sender-regexp . "Allowed senders for mail import: %#1s %#2s\n")
(conf-mx-list-name . "Imported mailing list: %#1s %#2s\n")
(conf-mx-refuse-import . "Refuse import of: %#1s %#2s\n")
(recommended-conf-aux . "Recommended conference: %#1M <%#1m> %#2s\n")
......@@ -1979,6 +1980,7 @@ Unknown variables may be the result of saving your settings in version
(aux-mx-misc-name . "E-mail headers")
(aux-mx-allow-filter-name . "E-mail allow-filter")
(aux-mx-reject-forward-name . "E-mail reject-forward")
(aux-mx-allow-envelope-sender-regexp . "Allowed senders for mail import")
(aux-notify-comments-name . "Notify me about comments")
(aux-faq-for-conf-name . "FAQ for conference")
(aux-recommended-conf-name . "Conference recommendation")
......@@ -2067,10 +2069,13 @@ manual and the command set-language-environment for more information).
(abc-html . "hHTML")
(abc-spam . "sSpam")
(abc-everything . "aAll texts")
(abc-regexp . "rAllow sender")
(limit-import-regexp-q . "Allow only which sender (regexp)? ")
(limit-import-to-conf . "Limit import to which conference? ")
(limit-import-of-what . "Limit import of what? ")
(limit-import-not-super . "You do not seem to be the supervisor of the conference. Try anyway? ")
(limiting-import . "Limiting import of %#1s to %#2M...")
(limiting-import-regexp . "Limiting import to %#2M to sender %#1s...")
(set-message-flag-for-conf . "Sett message flag for which conference? ")
(set-message-flag-to-what . "Receive grupp messages to %#1M? ")
......
......@@ -1963,7 +1963,7 @@ This command accepts text number prefix arguments \(see
(if text-no
(let ((kom-view-text-hook kom-view-text-hook))
(unless kom-review-uses-cache (cache-del-text-stat text-no))
(add-hook 'kom-view-text-hook 'lyskom-filter-rot13 nil t)
(add-hook 'kom-view-text-hook 'lyskom-filter-rot13)
(lyskom-view-text text-no)
)
(lyskom-insert 'confusion-what-to-view)))
......
......@@ -726,6 +726,7 @@ i svensk datorhistoria. L
(conf-has-motd . "\n%#1M har en lapp p drren:\n")
(status-conf-generic . "%-40#1s %#2s\n")
(status-aux-item . "Oknd tillggsinformation: %15#1s%#3s (skapad av %#2M)\n")
(conf-mx-allow-envelope-sender-regexp . "Tillten avsndare vid import: %#1s %#2s\n")
(conf-mx-list-name . "Importerad mailinglista: %#1s %#2s\n")
(conf-mx-refuse-import . "Vgra import av: %#1s %#2s\n")
(recommended-conf-aux . "Rekommenderat mte: %#1M <%#1m> %#2s\n")
......@@ -2028,6 +2029,7 @@ version %#3s av elispklienten, medan detta
(aux-mx-misc-name . "E-mailheader")
(aux-mx-allow-filter-name . "E-mail allow-filter")
(aux-mx-reject-forward-name . "E-mail reject-forward")
(anx-mx-allow-envelope-sender-regexp . "Tillten avsndare vid import:")
(aux-notify-comments-name . "Meddela kommentarer")
(aux-faq-for-conf-name . "FAQ fr mte")
(aux-recommended-conf-name . "Mtesrekommendation")
......@@ -2115,10 +2117,13 @@ f
(abc-html . "hHTML")
(abc-spam . "sSpam")
(abc-everything . "aAlla texter")
(abc-regexp . "tTillt avsndare")
(limit-import-regexp-q . "Tillt endast vilken avsndare (regexp)? ")
(limit-import-to-conf . "Begrnsa import till vilket mte? ")
(limit-import-of-what . "Begrnsa import av vad? ")
(limit-import-not-super . "Du verkar inte vara organisatr fr mtet. Frsk nd? ")
(limiting-import . "Begrnsar import av %#1s i %#2M...")
(limiting-import-regexp . "Begrnsar import till %#2M till avsnare %#1s...")
(set-message-flag-for-conf . "ndra meddelandeflagga fr vilket mte? ")
(set-message-flag-to-what . "Vill du ta emot gruppmeddelanden till %#1M? ")
......
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