Attachment 'moin_jabberbot_rfc_compliant_message_type.patch'
Download 1 diff -r 38110c49d0a6 -r 4e486910c2c5 jabberbot/commands.py
2 --- a/jabberbot/commands.py Sun Feb 01 17:15:09 2009 +0100
3 +++ b/jabberbot/commands.py Sun Feb 01 23:51:58 2009 +0100
4 @@ -14,7 +14,7 @@
5 # First, XML RPC -> XMPP commands
6 class NotificationCommand:
7 """Class representing a notification request"""
8 - def __init__(self, jids, notification, msg_type=u"message", async=True):
9 + def __init__(self, jids, notification, msg_type=u"normal", async=True):
10 """A constructor
11
12 @param jids: a list of jids to sent this message to
13 @@ -33,7 +33,7 @@
14
15 class NotificationCommandI18n(NotificationCommand):
16 """Notification request that should be translated by the XMPP bot"""
17 - def __init__(self, jids, notification, msg_type="message", async=True):
18 + def __init__(self, jids, notification, msg_type="normal", async=True):
19 """A constructor
20
21 Params as in NotificationCommand.
22 diff -r 38110c49d0a6 -r 4e486910c2c5 jabberbot/xmppbot.py
23 --- a/jabberbot/xmppbot.py Sun Feb 01 17:15:09 2009 +0100
24 +++ b/jabberbot/xmppbot.py Sun Feb 01 23:51:58 2009 +0100
25 @@ -603,7 +603,7 @@
26 }
27
28 data = {'text': message, 'subject': msg_data.get('subject', '')}
29 - self.send_message(jid, data, u"message")
30 + self.send_message(jid, data, u"normal")
31
32 def send_deleted_form(self, jid, msg_data):
33 """Sends a page deleted notification using Data Forms
34 @@ -669,7 +669,7 @@
35 }
36
37 data = {'text': message, 'subject': msg_data.get('subject', '')}
38 - self.send_message(jid, data, u"message")
39 + self.send_message(jid, data, u"normal")
40
41 def send_attached_form(self, jid, msg_data):
42 """Sends a new attachment notification using Data Forms
43 @@ -739,7 +739,7 @@
44 }
45
46 data = {'text': message, 'subject': msg_data['subject']}
47 - self.send_message(jid, data, u"message")
48 + self.send_message(jid, data, u"normal")
49
50 def send_renamed_form(self, jid, msg_data):
51 """Sends a page rename notification using Data Forms
52 @@ -813,7 +813,7 @@
53 }
54
55 data = {'text': message, 'subject': msg_data['subject']}
56 - self.send_message(jid, data, u"message")
57 + self.send_message(jid, data, u"normal")
58
59 def handle_page_info(self, command):
60 """Handles GetPageInfo commands
61 @@ -983,7 +983,7 @@
62 self.handle_search_form(jid, form)
63 else:
64 data = {'text': _('The form you submitted was invalid!'), 'subject': _('Invalid data')}
65 - self.send_message(jid.as_unicode(), data, u"message")
66 + self.send_message(jid.as_unicode(), data, u"normal")
67 elif "options" in form:
68 option = form["options"].value
69
70 @@ -1022,7 +1022,7 @@
71 for field in required_fields:
72 if field not in form:
73 data = {'text': _('The form you submitted was invalid!'), 'subject': _('Invalid data')}
74 - self.send_message(jid.as_unicode(), data, u"message")
75 + self.send_message(jid.as_unicode(), data, u"normal")
76
77 case_sensitive = form['case'].value
78 regexp_terms = form['regexp'].value
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.