summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDico <Dico200@users.noreply.github.com>2015-11-04 12:01:38 +0100
committerDico <Dico200@users.noreply.github.com>2015-11-04 12:01:38 +0100
commit93c9bab421cadc26d2af32a882d38763ddf43bc5 (patch)
tree90007d894cfec48a933e46a6b69e1fe095775bd3
parent4a4cdc839be140dc9486b2cffd8c065365a70404 (diff)
Chatgroups optimization
The message is now colorified just once, not for every recipient. I'll test all this at home <3
-rw-r--r--chatgroups.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/chatgroups.py b/chatgroups.py
index 2cd496a..9965b96 100644
--- a/chatgroups.py
+++ b/chatgroups.py
@@ -79,13 +79,15 @@ def groupchat(sender, message, ann = False):
mesg = "&8[&bCG&8] &e&o%s&e&o %s" % (name, message)
else:
mesg = "&8[&bCG&8] &f%s&f: &6%s" % (name, message)
+ mesg = colorify(mesg)
+
info("[ChatGroups] %s (%s): %s" % (sender.getDisplayName(), group, message))
- do_for_chatgroup(group, msg, mesg)
+ do_for_chatgroup(group, msg, mesg, usecolor = False)
-def do_for_chatgroup(group, func, args):
+def do_for_chatgroup(group, func, *args, **kwargs):
for receiver in server.getOnlinePlayers():
if groups.get(uid(receiver)) == group:
- func(receiver, args)
+ func(receiver, args, kwargs)
def send_tpa_request(receiver, sender):
if not receiver == sender: