more metadata fallbacks

This commit is contained in:
Dpeta 2022-06-06 23:03:12 +02:00
parent 03a00501b2
commit a7abd6deb7
2 changed files with 22 additions and 0 deletions

20
irc.py
View file

@ -554,6 +554,26 @@ class PesterHandler(DefaultCommandHandler):
PchumLog.warning(e) PchumLog.warning(e)
self.parent.setConnectionBroken() self.parent.setConnectionBroken()
def keynotset(self, target, our_handle, failed_handle, key, *error):
# Try to get moods the old way if metadata fails.
PchumLog.info("nomatchingkey: " + failed_handle)
chumglub = "GETMOOD "
try:
helpers.msg(self.client, "#pesterchum", chumglub + failed_handle)
except socket.error as e:
PchumLog.warning(e)
self.parent.setConnectionBroken()
def keynopermission(self, target, our_handle, failed_handle, key, *error):
# Try to get moods the old way if metadata fails.
PchumLog.info("nomatchingkey: " + failed_handle)
chumglub = "GETMOOD "
try:
helpers.msg(self.client, "#pesterchum", chumglub + failed_handle)
except socket.error as e:
PchumLog.warning(e)
self.parent.setConnectionBroken()
def featurelist(self, target, handle, *params): def featurelist(self, target, handle, *params):
# RPL_ISUPPORT # RPL_ISUPPORT
features = params[:-1] features = params[:-1]

View file

@ -186,6 +186,8 @@ metadata_numeric_events = {
"761": "keyvalue", "761": "keyvalue",
"762": "metadataend", "762": "metadataend",
"766": "nomatchingkey", "766": "nomatchingkey",
"768": "keynotset",
"769": "keynopermission",
"770": "metadatasubok", "770": "metadatasubok",
} }
numeric_events.update(metadata_numeric_events) numeric_events.update(metadata_numeric_events)