diff MoinMoin/action/AttachFile.py @ 2106:1577663f6354

Notify when a new attachment is added to a page. s/JabberBot/jabberbot/.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Thu, 07 Jun 2007 17:53:30 +0200
parents dd3a1da58c28
children 316bbfb37f2b
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Jun 07 12:43:31 2007 +0200
+++ b/MoinMoin/action/AttachFile.py	Thu Jun 07 17:53:30 2007 +0200
@@ -30,6 +30,7 @@
 from MoinMoin import config, wikiutil, packages
 from MoinMoin.Page import Page
 from MoinMoin.util import filesys, timefuncs
+from MoinMoin.events import FileAttachedEvent, send_event
 
 action_name = __name__.split('.')[-1]
 
@@ -219,6 +220,10 @@
             stream.close()
 
         _addLogEntry(request, 'ATTNEW', pagename, target)
+        
+        event = FileAttachedEvent(request, pagename, target, len(filecontent))
+        messages = send_event(event)
+        msg = "".join(messages)
 
         if request.cfg.xapian_search:
             from MoinMoin.search.Xapian import Index