changeset 2105:cc5067ea1235

Fix brain-damaged behaviour I introduced yestarday.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Thu, 07 Jun 2007 12:43:31 +0200
parents c2114faf540e
children 1577663f6354
files MoinMoin/events/JabberNotification.py MoinMoin/userform.py
diffstat 2 files changed, 5 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/JabberNotification.py	Thu Jun 07 12:39:33 2007 +0200
+++ b/MoinMoin/events/JabberNotification.py	Thu Jun 07 12:43:31 2007 +0200
@@ -44,22 +44,12 @@
     
     request = event.request
     _ = request.getText
-    notification_list = []
     
-    ids = getUserList(request)
-    for id in ids:
-        usr = User(request, id)
-        if usr.isSuperUser():
-            notification_list.append(usr)
-    
-    # FIXME: stops sending notifications on first error
     try:
         if isinstance(event, JabberIDSetEvent):
-            for jid in notification_list:
-                server.addJIDToRoster(request.cfg.secret, jid)
+            server.addJIDToRoster(request.cfg.secret, event.jid)
         else:
-            for jid in notification_list:
-                server.removeJIDFromRoster(request.cfg.secret, jid)        
+            server.removeJIDFromRoster(request.cfg.secret, event.jid)        
                 
     except xmlrpclib.Error, err:
         print _("XML RPC error: "), str(err)
--- a/MoinMoin/userform.py	Thu Jun 07 12:39:33 2007 +0200
+++ b/MoinMoin/userform.py	Thu Jun 07 12:43:31 2007 +0200
@@ -235,7 +235,8 @@
             # try to get the jid
             jid = wikiutil.clean_input(form.get('jid', [theuser.jid])[0]).strip()
             
-            jid_changed = theuser.jid != jid                
+            jid_changed = theuser.jid != jid
+            previous_jid = theuser.jid           
             theuser.jid = jid
             
             if theuser.jid and self.request.cfg.user_jid_unique:
@@ -245,7 +246,7 @@
             
             if jid_changed:
                 set_event = JabberIDSetEvent(self.request, theuser.jid)
-                unset_event = JabberIDUnsetEvent(self.request, theuser.jid)
+                unset_event = JabberIDUnsetEvent(self.request, previous_jid)
                 send_event(set_event)
                 send_event(unset_event)