Attachment 'moin_jabberbot_user_created_notification.patch'

Download

   1 diff -r 4e486910c2c5 -r 6058776e9db0 jabberbot/xmppbot.py
   2 --- a/jabberbot/xmppbot.py	Sun Feb 01 23:51:58 2009 +0100
   3 +++ b/jabberbot/xmppbot.py	Mon Feb 02 21:06:33 2009 +0100
   4 @@ -417,8 +417,9 @@
   5          @type contact: Contact
   6  
   7          """
   8 -        pass
   9 -
  10 +        # TODO: send as form if user-client supports it
  11 +        self.send_user_created_text(jid.as_unicode(), cmd_data)
  12 +        
  13      def ask_for_subscription(self, jid):
  14          """Sends a <presence/> stanza with type="subscribe"
  15  
  16 @@ -811,6 +812,21 @@
  17                      'comment': msg_data.get('comment', _('no comment')),
  18                      'links': urls_text,
  19                    }
  20 +
  21 +        data = {'text': message, 'subject': msg_data['subject']}
  22 +        self.send_message(jid, data, u"normal")
  23 +
  24 +    def send_user_created_text(self, jid, msg_data):
  25 +        """Sends a simple, text page user-created-notification
  26 +
  27 +        @param jid: a Jabber ID to send the notification to
  28 +        @type jid: unicode
  29 +        @param msg_data: dictionary with notification data
  30 +        @type msg_data: dict
  31 +
  32 +        """
  33 +        _ = self.get_text(jid)
  34 +        message = _("%(text)s") % {'text': msg_data['text']}
  35  
  36          data = {'text': message, 'subject': msg_data['subject']}
  37          self.send_message(jid, data, u"normal")

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.
  • [get | view] (2009-02-02 21:05:56, 1.3 KB) [[attachment:moin_jabberbot_user_created_notification.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.