Try to restaure frm_owner flag
This commit is contained in:
parent
c51b0a9170
commit
205a39ad70
@ -21,7 +21,7 @@ class Abstract:
|
||||
|
||||
"""This class represents an abstract message"""
|
||||
|
||||
def __init__(self, server=None, date=None, to=None, to_response=None, frm=None):
|
||||
def __init__(self, server=None, date=None, to=None, to_response=None, frm=None, frm_owner=False):
|
||||
"""Initialize an abstract message
|
||||
|
||||
Arguments:
|
||||
@ -40,7 +40,7 @@ class Abstract:
|
||||
else [ to_response ])
|
||||
self.frm = frm # None allowed when it designate this bot
|
||||
|
||||
self.frm_owner = False # Filled later, in consumer
|
||||
self.frm_owner = frm_owner
|
||||
|
||||
|
||||
@property
|
||||
@ -78,7 +78,8 @@ class Abstract:
|
||||
"date": self.date,
|
||||
"to": self.to,
|
||||
"to_response": self._to_response,
|
||||
"frm": self.frm
|
||||
"frm": self.frm,
|
||||
"frm_owner": self.frm_owner,
|
||||
}
|
||||
|
||||
for w in without:
|
||||
|
@ -150,7 +150,8 @@ class IRC(Abstract):
|
||||
"date": self.tags["time"],
|
||||
"to": receivers,
|
||||
"to_response": [r if r != srv.nick else self.nick for r in receivers],
|
||||
"frm": self.nick
|
||||
"frm": self.nick,
|
||||
"frm_owner": self.nick == srv.owner
|
||||
}
|
||||
|
||||
# If CTCP, remove 0x01
|
||||
|
@ -109,6 +109,9 @@ class MessageTreater:
|
||||
msg -- message to treat
|
||||
"""
|
||||
|
||||
if hasattr(msg, "frm_owner"):
|
||||
msg.frm_owner = (not hasattr(msg.server, "owner") or msg.server.owner == msg.frm)
|
||||
|
||||
while hook is not None:
|
||||
res = hook.run(msg)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user