def subscribe(): sender_addr = request.POST["from"].split('/')[0] stanza = request.POST["stanza"] SubscribeContacts.get_or_insert(sender_addr, addr=sender_addr, stanza=stanza) logging.debug(stanza)
def push_retweet(): dbkey = request.POST["dbkey"] t = SavedTweets.get(keys=dbkey) if t is not None: t.tweet_text map(lambda ct: xmpp.send_message(ct.addr, t.tweet_text), SubscribeContacts.all().fetch(limit=10)) t.pushed_flag = True t.put()
def unsubscribe(): sender_addr = request.POST["from"].split('/')[0] ct = SubscribeContacts.get_by_key_name(sender_addr) ct.delete() logging.debug(request.POST["stanza"])
def send_direct_post(): msg = request.POST["msg"] for ct in SubscribeContacts.all().fetch(limit=10): xmpp.send_message(ct.addr, msg) return dict(msg=msg.decode('utf-8'))
def man_subscribe_post(): sender_addr = request.POST["addr"] SubscribeContacts.get_or_insert(sender_addr, addr=sender_addr, stanza='') return dict(users=SubscribeContacts.all().fetch(limit=100))
def man_subscribe(): return dict(users=SubscribeContacts.all().fetch(limit=100))