Escaped the IRC username to avoid it being parsed for ANSI colors (keeping ansi parsing in normal text for now). Resolves #935."

This commit is contained in:
Griatch 2016-04-11 23:30:46 +02:00
parent 187b8eb7ab
commit 04e461b1f4

View file

@ -11,7 +11,7 @@ from twisted.application import internet
from twisted.words.protocols import irc
from twisted.internet import protocol, reactor
from evennia.server.session import Session
from evennia.utils import logger, utils
from evennia.utils import logger, utils, ansi
# IRC colors
@ -177,6 +177,7 @@ class IRCBot(irc.IRCClient, Session):
"""
if not msg.startswith('***'):
user = user.split('!', 1)[0]
user = ansi.raw(user)
self.data_in("bot_data_in %s@%s: %s" % (user, channel, msg))
def action(self, user, channel, msg):
@ -202,6 +203,7 @@ class IRCBot(irc.IRCClient, Session):
kwargs (any): Other data from protocol.
"""
self.sessionhandler.data_in(self, text=text, **kwargs)
def send_text(self, *args, **kwargs):