changeset 2342:24242585fd70

Warn user if we failed to get a token using his credentials.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Mon, 09 Jul 2007 00:29:38 +0200
parents dbfe98af770a
children b745ea150288 d680aee762a7
files jabberbot/xmlrpcbot.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/xmlrpcbot.py	Thu Jul 05 22:11:16 2007 +0200
+++ b/jabberbot/xmlrpcbot.py	Mon Jul 09 00:29:38 2007 +0200
@@ -110,13 +110,18 @@
 
         return wrapped_func
 
+    def warn_no_credentials(self, jid):
+        msg = u"""Credentials check failed, you may be unable to see all information."""
+        warning = cmd.NotificationCommand([jid], msg)
+        self.commands_out.put_nowait(warning)
+        
     def get_page(self, command):
         """Returns a raw page"""
 
         self.multicall.getPage(command.pagename)
 
         if not self.token:
-            # FIXME: notify the user that he may not have full rights on the wiki
+            self.warn_no_credentials(command.jid)
             getpage_result = self.multicall()
         else:
             getpage_result, token_result = self.multicall()
@@ -133,7 +138,7 @@
         self.multicall.getPageHTML(command.pagename)
 
         if not self.token:
-            # FIXME: notify the user that he may not have full rights on the wiki
+            self.warn_no_credentials(command.jid)
             getpagehtml_result = self.multicall()
         else:
             token_result, getpagehtml_result = self.multicall()