changeset 2343:b745ea150288

Merge with my devel branch.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Mon, 09 Jul 2007 00:30:22 +0200
parents 338334a0d38d (current diff) 24242585fd70 (diff)
children bf3ec2aadfb6
files
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/xmlrpcbot.py	Mon Jul 09 00:30:05 2007 +0200
+++ b/jabberbot/xmlrpcbot.py	Mon Jul 09 00:30:22 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()