diff MoinMoin/action/AttachFile.py @ 2318:062b76cf8d48

Introduce an base EventResult class for event handler return values. Make send_notification use a list of jids, instead of one. I'll remove prints tomorrow.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sat, 23 Jun 2007 00:01:56 +0200
parents 316bbfb37f2b
children 10be78f1fa97
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Fri Jun 22 19:00:44 2007 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Jun 23 00:01:56 2007 +0200
@@ -222,8 +222,16 @@
         _addLogEntry(request, 'ATTNEW', pagename, target)
         
         event = FileAttachedEvent(request, pagename, target, len(filecontent))
-        messages = send_event(event)
-        msg = "".join(messages)
+        results = events.send_event(event)    
+        
+        recipients = []
+        for result in results:
+            if isinstance(results, notification.Success):
+                recipients.append(result.recipient)
+                
+        if recipients:
+            info = _("Notifications sent to:")
+            msg = msg + "<p>%s %s</p>" % (info, ",".join(recipients))
 
         if request.cfg.xapian_search:
             from MoinMoin.search.Xapian import Index