def stop_notifications(self, from_jid): jid_ref = api.actor_lookup_im(api.ROOT, from_jid.base()) if not jid_ref: raise exception.ValidationError("You are not signed in.") actor_ref = api.settings_change_notify(api.ROOT, jid_ref.nick, im=False) self.send_message([from_jid], HELP_STOP_NOTIFICATIONS)
def start_notifications(self, from_jid): jid_ref = api.actor_lookup_im(api.ROOT, from_jid.base()) if not jid_ref: raise exception.ValidationError("You are not signed in.") actor_ref = api.settings_change_notify(api.ROOT, jid_ref.nick, im=True) self.send_message([from_jid], HELP_START_NOTIFICATIONS)
def stop_notifications(self, sender): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if not sender_ref: raise exception.ValidationError(HELP_SIGN_IN) actor_ref = api.settings_change_notify(api.ROOT, sender_ref.nick, sms=False) self.send_message([sender], HELP_STOP_NOTIFICATIONS)
def start_notifications(self, sender): sender_ref = api.actor_lookup_mobile(api.ROOT, sender) if not sender_ref: raise exception.ValidationError(HELP_SIGN_IN) if sender_ref.extra.get('sms_double_opt_in', None): message = ' '.join([HELP_DOUBLE_OPT_IN, HELP_CHARGES]) self.send_message([sender], message) return actor_ref = api.settings_change_notify(api.ROOT, sender_ref.nick, sms=True) message = ' '.join([HELP_START_NOTIFICATIONS, HELP_CHARGES]) self.send_message([sender], message)