def actor_add_contact(self, sender, nick): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if not sender_ref: raise exception.ValidationError(HELP_SIGN_IN) clean_nick = clean.nick(nick) try: api.actor_add_contact(sender_ref, sender_ref.nick, clean_nick) self.send_message((sender,), "%s followed %s" % (sender_ref.display_nick(), nick)) except: self.send_message((sender,), "Failed to follow %s" % nick)
def actor_add_contact(self, from_jid, nick): 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") nick = clean.nick(nick) try: api.actor_add_contact(jid_ref, jid_ref.nick, nick) self.send_message((from_jid, ), "%s followed %s" % (jid_ref.nick, nick)) except: self.send_message((from_jid, ), "Follow FAILED: %s" % nick)
def actor_add_contact(self, sender, nick): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if not sender_ref: raise exception.ValidationError(HELP_SIGN_IN) clean_nick = clean.nick(nick) try: api.actor_add_contact(sender_ref, sender_ref.nick, clean_nick) self.send_message( (sender, ), "%s followed %s" % (sender_ref.display_nick(), nick)) except: self.send_message((sender, ), "Failed to follow %s" % nick)
def actor_add_contact(self, from_jid, nick): 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") nick = clean.nick(nick) try: api.actor_add_contact(jid_ref, jid_ref.nick, nick) self.send_message((from_jid,), "%s followed %s" % (jid_ref.nick, nick)) except: self.send_message((from_jid,), "Follow FAILED: %s" % nick)