def tell(cmd, nick, message): if request.type == 'groupchat': to_jid = JID(request.jid) to_jid.resource = nick from_jid = request.username else: to_jid = nick from_jid = request.environ['xmpp.jid'] ts = datetime.datetime.utcfromtimestamp(request.environ['xmpp.timestamp']) MESSAGE_QUEUE[to_jid].put(( 'message', {'to': to_jid, 'body': '[%sZ] %s: %s' % (ts, from_jid, message)} )) return render_template('tell.html')
def tell(cmd, nick, message): if request.type == 'groupchat': to_jid = JID(request.jid) to_jid.resource = nick from_jid = request.username else: to_jid = nick from_jid = request.environ['xmpp.jid'] ts = datetime.datetime.utcfromtimestamp(request.environ['xmpp.timestamp']) MESSAGE_QUEUE[to_jid].put(('message', { 'to': to_jid, 'body': '[%sZ] %s: %s' % (ts, from_jid, message) })) return render_template('tell.html')
def tell(nick, message, **kwargs): """Sends to the specified user the message when he becomes available""" if request.type == 'groupchat': to_jid = JID(request.jid) to_jid.resource = nick from_jid = request.username else: to_jid = nick from_jid = request.environ['xmpp.jid'] ts = datetime.datetime.utcfromtimestamp(request.environ['xmpp.timestamp']) MESSAGE_QUEUE[to_jid].put(( 'message', {'to': to_jid, 'body': '[%sZ] %s: %s' % (ts, from_jid, message)} )) return render_template('tell.html')