def headCb(payload): req.result = id if uid: log.push("%s/head" % uid, simplejson.dumps({"type": type, "params": params, "body": safeBody})) res.callback(None)
def headCb(payload): req.result = id if uid: log.push( "%s/head" % uid, simplejson.dumps({ 'type': type, 'params': params, 'body': safeBody })) res.callback(None)
def broadcastCb(payload): if puid: def uidCb(payload): res.callback(None) if puid: log.push("%s/reply" % uid, simplejson.dumps({'reply': broadcast['tail'][0]})) d4 = comm.broadcast('/user/' + puid, simplejson.dumps({'reply': broadcast})) d4.addCallback(uidCb) else: res.callback(None)
def tailCb(payload): if payload: payload = simplejson.loads(payload) broadcast = { 'tail': [{ 'id': id, 'parent': pid, 'uid': uid, 'lid': lid, 'user': user, 'type': type, 'params': params, 'body': safeBody, 'time': time }], 'users': [payload] } def broadcastCb(payload): if puid: def uidCb(payload): res.callback(None) if puid: log.push( "%s/reply" % uid, simplejson.dumps( {'reply': broadcast['tail'][0]})) d4 = comm.broadcast( '/user/' + puid, simplejson.dumps({'reply': broadcast})) d4.addCallback(uidCb) else: res.callback(None) if uid: log.push("%s/tail" % uid, simplejson.dumps({'tail': broadcast['tail'][0]})) d3 = comm.broadcast('/chan/tail_' + lid, simplejson.dumps({'broadcast': broadcast})) d3.addCallback(broadcastCb)
def broadcastCb(payload): if puid: def uidCb(payload): res.callback(None) if puid: log.push( "%s/reply" % uid, simplejson.dumps( {'reply': broadcast['tail'][0]})) d4 = comm.broadcast( '/user/' + puid, simplejson.dumps({'reply': broadcast})) d4.addCallback(uidCb) else: res.callback(None)
def tailCb(payload): if payload: payload = simplejson.loads(payload) broadcast = { 'tail' : [{ 'id' : id, 'parent' : pid, 'uid' : uid, 'lid' : lid, 'user' : user, 'type' : type, 'params' : params, 'body' : safeBody, 'time' : time }], 'users' : [payload] } def broadcastCb(payload): if puid: def uidCb(payload): res.callback(None) if puid: log.push("%s/reply" % uid, simplejson.dumps({'reply': broadcast['tail'][0]})) d4 = comm.broadcast('/user/' + puid, simplejson.dumps({'reply': broadcast})) d4.addCallback(uidCb) else: res.callback(None) if uid: log.push("%s/tail" % uid, simplejson.dumps({'tail': broadcast['tail'][0]})) d3 = comm.broadcast('/chan/tail_' + lid, simplejson.dumps({'broadcast': broadcast})) d3.addCallback(broadcastCb)