changeset 4542:9a3e85b44c25

Applying a patch from Noya to use an RFC compliant message type.
author Karol 'grzywacz' Nowak <grywacz@gmail.com>
date Tue, 03 Feb 2009 02:15:31 +0100
parents 38110c49d0a6
children 544679a8a444
files jabberbot/commands.py jabberbot/xmppbot.py
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/jabberbot/commands.py	Sun Feb 01 17:15:09 2009 +0100
+++ b/jabberbot/commands.py	Tue Feb 03 02:15:31 2009 +0100
@@ -14,7 +14,7 @@
 # First, XML RPC -> XMPP commands
 class NotificationCommand:
     """Class representing a notification request"""
-    def __init__(self, jids, notification, msg_type=u"message", async=True):
+    def __init__(self, jids, notification, msg_type=u"normal", async=True):
         """A constructor
 
         @param jids: a list of jids to sent this message to
@@ -33,7 +33,7 @@
 
 class NotificationCommandI18n(NotificationCommand):
     """Notification request that should be translated by the XMPP bot"""
-    def __init__(self, jids, notification, msg_type="message", async=True):
+    def __init__(self, jids, notification, msg_type="normal", async=True):
         """A constructor
 
         Params as in NotificationCommand.
--- a/jabberbot/xmppbot.py	Sun Feb 01 17:15:09 2009 +0100
+++ b/jabberbot/xmppbot.py	Tue Feb 03 02:15:31 2009 +0100
@@ -603,7 +603,7 @@
                   }
 
         data = {'text': message, 'subject': msg_data.get('subject', '')}
-        self.send_message(jid, data, u"message")
+        self.send_message(jid, data, u"normal")
 
     def send_deleted_form(self, jid, msg_data):
         """Sends a page deleted notification using Data Forms
@@ -669,7 +669,7 @@
                   }
 
         data = {'text': message, 'subject': msg_data.get('subject', '')}
-        self.send_message(jid, data, u"message")
+        self.send_message(jid, data, u"normal")
 
     def send_attached_form(self, jid, msg_data):
         """Sends a new attachment notification using Data Forms
@@ -739,7 +739,7 @@
                   }
 
         data = {'text': message, 'subject': msg_data['subject']}
-        self.send_message(jid, data, u"message")
+        self.send_message(jid, data, u"normal")
 
     def send_renamed_form(self, jid, msg_data):
         """Sends a page rename notification using Data Forms
@@ -813,7 +813,7 @@
                   }
 
         data = {'text': message, 'subject': msg_data['subject']}
-        self.send_message(jid, data, u"message")
+        self.send_message(jid, data, u"normal")
 
     def handle_page_info(self, command):
         """Handles GetPageInfo commands
@@ -983,7 +983,7 @@
                 self.handle_search_form(jid, form)
             else:
                 data = {'text': _('The form you submitted was invalid!'), 'subject': _('Invalid data')}
-                self.send_message(jid.as_unicode(), data, u"message")
+                self.send_message(jid.as_unicode(), data, u"normal")
         elif "options" in form:
             option = form["options"].value
 
@@ -1022,7 +1022,7 @@
         for field in required_fields:
             if field not in form:
                 data = {'text': _('The form you submitted was invalid!'), 'subject': _('Invalid data')}
-                self.send_message(jid.as_unicode(), data, u"message")
+                self.send_message(jid.as_unicode(), data, u"normal")
 
         case_sensitive = form['case'].value
         regexp_terms = form['regexp'].value