|
|
|
|
@ -13,7 +13,7 @@ import config |
|
|
|
|
# HOLDBACK ... how long will brathuhn wait |
|
|
|
|
# to tell someone |
|
|
|
|
DELAY = 60*60*24 |
|
|
|
|
HOLDBACK = 60*60*24*7 # TODO make brathuhn tell if it deletes messages |
|
|
|
|
HOLDBACK = 60*60*24*7 # TODO brathuhn should tell if it deletes messages |
|
|
|
|
############################################## |
|
|
|
|
|
|
|
|
|
container = PersistentContainer(__name__+'_data',config.PCACHE) |
|
|
|
|
@ -24,7 +24,7 @@ def tell(msg, args): |
|
|
|
|
global container |
|
|
|
|
store = container["store"] |
|
|
|
|
|
|
|
|
|
if( len(args) <= 2): |
|
|
|
|
if( len(args) == 2): |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,"Usage: "+args[0]+" nick text",'groupchat') |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
@ -34,14 +34,12 @@ def tell(msg, args): |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,"User "+args[1]+" is already here, tell them yourself!",'groupchat') |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
body = unicode(msg.getBody()) |
|
|
|
|
spl = body.split(' ', 2) |
|
|
|
|
message = spl[2] |
|
|
|
|
nick = spl[1] |
|
|
|
|
origin = msg.getFrom().getResource() |
|
|
|
|
message = args[2] |
|
|
|
|
nick = args[1] |
|
|
|
|
origin = msg.getFrom().getResource() #TODO ugly |
|
|
|
|
store.append( (nick, message, origin, datetime.today()) ) |
|
|
|
|
container["store"] = store |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,origin+": will do!",'groupchat') |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,origin+': will send "'+message+'" to "'+nick+'"!','groupchat') |
|
|
|
|
|
|
|
|
|
def tellCB(nick, msg, status): |
|
|
|
|
global container |
|
|
|
|
|