Nope, revert echo-message support. a certain network only offers it in channel,

not private.
This commit is contained in:
jesopo 2018-09-03 22:32:48 +01:00
parent 1c474771c5
commit d90a5164da
2 changed files with 20 additions and 33 deletions

View file

@ -8,8 +8,7 @@ RE_CHANTYPES = re.compile(r"\bCHANTYPES=(\W+)(?:\b|$)")
RE_MODES = re.compile(r"[-+]\w+")
CAPABILITIES = {"message-tags", "multi-prefix", "chghost", "invite-notify",
"account-tag", "account-notify", "extended-join", "away-notify",
"echo-message"}
"account-tag", "account-notify", "extended-join", "away-notify"}
class LineHandler(object):
def __init__(self, bot, events):
@ -380,20 +379,9 @@ class LineHandler(object):
if target[0] in event["server"].channel_types:
channel = event["server"].get_channel(event["args"][0])
if not event["server"].is_own_nickname(nickname):
self.events.on("received.message.channel").call(
user=user, channel=channel, **kwargs)
channel.buffer.add_line(user.nickname, message, action)
else:
# supporting echo-message
self.events.on("self.message.channel").call(
channel=channel, **kwargs)
channel.buffer.add_line(user.nickname, message, action, True)
elif event["server"].is_own_nickname(nickname):
# supporting echo-message
self.events.on("self.message.private").call(
user=event["server"].get_user(target), **kwargs)
elif event["server"].is_own_nickname(target):
self.events.on("received.message.private").call(
user=user, **kwargs)

View file

@ -331,7 +331,6 @@ class Server(object):
full_message = message if not prefix else prefix+message
self.send("PRIVMSG %s :%s" % (target, full_message))
if not "echo-message" in self.capabilities:
action = full_message.startswith("\01ACTION "
) and full_message.endswith("\01")