mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 19:24:23 +00:00
Merge pull request #18 from adator85/dev
Delete channel mode information
This commit is contained in:
@@ -263,7 +263,6 @@ class Channel:
|
||||
@dataclass
|
||||
class ChannelModel:
|
||||
name: str
|
||||
mode: str
|
||||
uids: list
|
||||
|
||||
UID_CHANNEL_DB: list[ChannelModel] = []
|
||||
@@ -302,21 +301,6 @@ class Channel:
|
||||
|
||||
return result
|
||||
|
||||
def update(self, name: str, newMode: str) -> bool:
|
||||
|
||||
result = False
|
||||
|
||||
for record in self.UID_CHANNEL_DB:
|
||||
if record.name == name:
|
||||
record.mode = newMode
|
||||
result = True
|
||||
self.log.debug(f'Mode ({record.name}) has been updated with new mode {newMode}')
|
||||
|
||||
if not result:
|
||||
self.log.critical(f'The channel mode {newMode} was not updated, name = {name}')
|
||||
|
||||
return result
|
||||
|
||||
def delete(self, name: str) -> bool:
|
||||
|
||||
result = False
|
||||
|
||||
@@ -713,11 +713,7 @@ class Irc:
|
||||
case 'MODE':
|
||||
#['@msgid=d0ySx56Yd0nc35oHts2SkC-/J9mVUA1hfM6+Z4494xWUg;time=2024-08-09T12:45:36.651Z',
|
||||
# ':001', 'MODE', '#a', '+nt', '1723207536']
|
||||
cmd.pop(0)
|
||||
if '#' in cmd[2]:
|
||||
channel = cmd[2]
|
||||
mode = cmd[3]
|
||||
self.Channel.update(channel, mode)
|
||||
pass
|
||||
|
||||
case 'SJOIN':
|
||||
# ['@msgid=5sTwGdj349D82L96p749SY;time=2024-08-15T09:50:23.528Z', ':001', 'SJOIN', '1721564574', '#welcome', ':001JD94QH']
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "5.0.2"
|
||||
"version": "5.0.3"
|
||||
}
|
||||
Reference in New Issue
Block a user