changeset 2674:9817a90b6fde

Fix subscriptions when there's no smtp host set, only notification bot.
author Karol Nowak <grzywacz@sul.uni.lodz.pl>
date Tue, 14 Aug 2007 11:44:12 +0200
parents 536e0505c071
children 37449fd9e70a
files MoinMoin/action/SubscribeUser.py MoinMoin/action/subscribe.py MoinMoin/theme/__init__.py MoinMoin/theme/classic.py
diffstat 4 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SubscribeUser.py	Mon Aug 13 23:53:50 2007 +0200
+++ b/MoinMoin/action/SubscribeUser.py	Tue Aug 14 11:44:12 2007 +0200
@@ -62,7 +62,7 @@
             realusers.append(userobj.name)
             if userobj.isSubscribedTo([pagename]):
                 success = True
-            elif not userobj.email:
+            elif not userobj.email and not userobj.jid:
                 success = False
             elif userobj.subscribe(pagename):
                 success = True
--- a/MoinMoin/action/subscribe.py	Mon Aug 13 23:53:50 2007 +0200
+++ b/MoinMoin/action/subscribe.py	Tue Aug 14 11:44:12 2007 +0200
@@ -18,16 +18,16 @@
         msg = _("You are not allowed to subscribe to a page you can't read.")
 
     # Check if mail is enabled
-    elif not cfg.mail_enabled:
-        msg = _("This wiki is not enabled for mail processing.")
+    elif not cfg.mail_enabled and not cfg.jabber_enabled
+        msg = _("This wiki is not enabled for mail/Jabber processing.")
 
     # Suggest visitors to login
     elif not request.user.valid:
         msg = _("You must log in to use subscriptions.")
 
     # Suggest users without email to add their email address
-    elif not request.user.email:
-        msg = _("Add your email address in your UserPreferences to use subscriptions.")
+    elif not request.user.email and not request.user.jid:
+        msg = _("Add your email address or Jabber ID in your UserPreferences to use subscriptions.")
 
     elif request.user.isSubscribedTo([pagename]):
         # Try to unsubscribe
@@ -46,3 +46,4 @@
             msg = _('You could not get subscribed to this page.')
 
     Page(request, pagename).send_page(msg=msg)
+
--- a/MoinMoin/theme/__init__.py	Mon Aug 13 23:53:50 2007 +0200
+++ b/MoinMoin/theme/__init__.py	Tue Aug 14 11:44:12 2007 +0200
@@ -1189,7 +1189,7 @@
         @rtype: unicode
         @return: subscribe or unsubscribe link
         """
-        if not (self.cfg.mail_enabled and self.request.user.valid):
+        if not (self.cfg.mail_enabled or self.cfg.jabber_enabled and self.request.user.valid):
             return ''
 
         _ = self.request.getText
--- a/MoinMoin/theme/classic.py	Mon Aug 13 23:53:50 2007 +0200
+++ b/MoinMoin/theme/classic.py	Tue Aug 14 11:44:12 2007 +0200
@@ -73,7 +73,7 @@
                 if icon == "up":
                     if d['page_parent_page']:
                         iconbar.append('<li>%s</li>\n' % self.make_iconlink(icon, d))
-                elif icon == "subscribe" and self.cfg.mail_enabled:
+                elif icon == "subscribe" and (self.cfg.mail_enabled or self.cfg.jabber_enabled):
                     iconbar.append('<li>%s</li>\n' % self.make_iconlink(
                         ["subscribe", "unsubscribe"][self.request.user.isSubscribedTo([d['page_name']])], d))
                 else: