Fix for mrelay, and blobs. (Spotted by Luckycharmmz/VA - ty for the fixing assistance!)

Orgmembers will nolonger get invited into the priv channel of their orgbot.. (on reboot only)
Added Nickname to !history (only useful for !history char_id>)
This commit is contained in:
2021-10-10 00:47:34 +02:00
parent 25eb552590
commit fc68950ade
8 changed files with 23 additions and 11 deletions
+9 -1
View File
@@ -190,22 +190,30 @@ class OrgRosterController:
@event(PublicChannelService.ORG_MSG_EVENT, "Update org roster when characters join or leave", is_hidden=True)
def org_msg_event(self, _, event_data):
ext_msg = event_data.extended_message
log = False
if [ext_msg.category_id, ext_msg.instance_id] == self.LEFT_ORG:
log = True
self.process_org_msg(ext_msg.params[0], self.MODE_REM_MANUAL, ext_msg)
elif [ext_msg.category_id, ext_msg.instance_id] == self.KICKED_FROM_ORG:
log = True
self.process_org_msg(ext_msg.params[1], self.MODE_REM_MANUAL, ext_msg.params[0])
elif [ext_msg.category_id, ext_msg.instance_id] == self.INVITED_TO_ORG:
log = True
self.process_org_msg(ext_msg.params[1], self.MODE_ADD_MANUAL, ext_msg.params[0])
elif [ext_msg.category_id, ext_msg.instance_id] == self.KICKED_INACTIVE_FROM_ORG:
log = True
self.process_org_msg(ext_msg.params[1], self.MODE_REM_MANUAL, ext_msg.params[0])
elif [ext_msg.category_id, ext_msg.instance_id] == self.KICKED_ALIGNMENT_CHANGED:
log = True
self.process_org_msg(ext_msg.params[0], self.MODE_REM_MANUAL)
elif [ext_msg.category_id, ext_msg.instance_id] == self.JOINED_ORG:
log = True
self.process_org_msg(ext_msg.params[0], self.MODE_ADD_MANUAL)
# This just writes everything to the log.... also tower messages, and so on. mainly for debugging reasons,
# may change in the future.
# noinspection SqlInsertValues
self.db.exec("INSERT INTO org_activity (message, time) VALUES(?, ?)", [ext_msg.get_message(), time.time()])
if log:
self.db.exec("INSERT INTO org_activity (message, time) VALUES(?, ?)", [ext_msg.get_message(), time.time()])
def process_org_msg(self, char_name, new_mode, actee=None):
char_id = self.character_service.resolve_char_to_id(char_name)