예제 #1
0
 def test_notify_on_channel_post(self):
   api.channel_post(api.ROOT, 
                    nick='popular', 
                    channel="#popular", 
                    message='la la la')
   # should notify popular and unpopular
   self.assertEqual(len(xmpp.outbox), 2)
예제 #2
0
  def channel_post(self, sender, channel_nick, message):
    sender_ref = api.actor_lookup_mobile(api.ROOT, sender)
    if not sender_ref:
      raise exception.ValidationError(HELP_SIGN_IN)

    comment_ref = api.channel_post(
        sender_ref,
        message=message,
        nick=sender_ref.nick,
        channel=channel_nick
    )
예제 #3
0
  def channel_post(self, from_jid, channel_nick, message):
    jid_ref = api.actor_lookup_im(api.ROOT, from_jid.base())
    if not jid_ref:
      raise exception.ValidationError(
          "You must be signed in to post, please SIGN IN")

    comment_ref = api.channel_post(
        jid_ref,
        message=message,
        nick=jid_ref.nick,
        channel=channel_nick
    )