bug fixes and improvements

- aliases are now handled properly in ABCH
- removed final escargot leftovers (dev webconsole)
- OSCAR etc. logging was not at log level debug
- removed leftover debug code
This commit is contained in:
Athena Funderburg committed 2026-11-06 00:36:13 +00:00
1 parent 4bf878556b
commit 6451bb9426
46 files changed
+307 -541

No files matched your search

+26 -26
View File
@@ -84,12 +84,12 @@ class ICBMFoodgroup:
@Subgroup(0x0002)
def add_paramenters(self, client: OSCARClient, context: OSCARContext, message: SNACMessage) -> None:
self.logger.info('[Client] ICBM__ADD_PARAMENTERS (not implemented)')
self.logger.info('[Client]', message.data.hex())
self.logger.debug('[Client] ICBM__ADD_PARAMENTERS (not implemented)')
self.logger.debug('[Client]', message.data.hex())
@Subgroup(0x0004)
def parameter_query(self, client: OSCARClient, context: OSCARContext, message: SNACMessage) -> None:
self.logger.info('[Client] ICBM__PARAMENTER_QUERY')
self.logger.debug('[Client] ICBM__PARAMENTER_QUERY')
response_msg = SNACMessage(0x0004, 0x0005, 0x0000, message.request_id)
@@ -109,7 +109,7 @@ class ICBMFoodgroup:
response_msg.write_u16(999) # maxDestinationEvil
response_msg.write_u32(0) # minInterICBMInterval
self.logger.info('[Server] ICBM__PARAMENTER_REPLY')
self.logger.debug('[Server] ICBM__PARAMENTER_REPLY')
client.send_snac(response_msg)
@Subgroup(0x0006)
@@ -119,19 +119,19 @@ class ICBMFoodgroup:
receiver = message.read_bytes(message.read_u8()).decode('latin-1')
tlvs = unmarshal_tlvs(message.data)
self.logger.info('[Client] ICBM__CHANNEL_MSG_TOHOST')
self.logger.info('[Client] Cookie:', cookie)
self.logger.info('[Client] Channel:', hex(channel))
self.logger.info('[Client] Message receiver:', receiver)
self.logger.debug('[Client] ICBM__CHANNEL_MSG_TOHOST')
self.logger.debug('[Client] Cookie:', cookie)
self.logger.debug('[Client] Channel:', hex(channel))
self.logger.debug('[Client] Message receiver:', receiver)
for tlv in tlvs:
self.logger.info('[Client] TLV', hex(tlv.type), '-', tlv.data)
self.logger.debug('[Client] TLV', hex(tlv.type), '-', tlv.data)
send = _Send(client, context, message, cookie, channel, receiver, tlvs)
target = names.resolve_user(context.backend, receiver)
if target is None or not names.representable(target):
self.logger.info('[Client] Unknown receiver:', receiver)
self.logger.debug('[Client] Unknown receiver:', receiver)
send.error(ICBMError.NotLoggedOn)
return
names.remember(context.bs, target, receiver)
@@ -148,13 +148,13 @@ class ICBMFoodgroup:
if channel == ICBMChannel.AOLIM:
im_data_tlv = find_tlv(tlvs, ICBMTag.ImData)
if im_data_tlv is None:
self.logger.info('[Client] Missing IM data TLV')
self.logger.debug('[Client] Missing IM data TLV')
return
text = parse_im_text(im_data_tlv.data)
if text is None:
self.logger.info('[Client] Missing IM text TLV inside IM data')
self.logger.debug('[Client] Missing IM text TLV inside IM data')
return
self.logger.info('[Client] Message text:', text)
self.logger.debug('[Client] Message text:', text)
if names.is_icq_session(context.bs) and not looks_like_html(text):
# ICQ sends plain text, where AIM sends HTML
send.text(text, plain_to_html(text))
@@ -166,16 +166,16 @@ class ICBMFoodgroup:
data_tlv = find_tlv(tlvs, ICBMTag.Data)
parsed = parse_icq_message(data_tlv.data) if data_tlv is not None else None
if parsed is None:
self.logger.info('[Client] Malformed channel 4 message')
self.logger.debug('[Client] Malformed channel 4 message')
return
send.icq(*parsed)
else:
self.logger.info('[Client] Unsupported channel:', hex(channel))
self.logger.debug('[Client] Unsupported channel:', hex(channel))
send.error(ICBMError.NotSupportedByHost)
@Subgroup(0x0008)
def evil_request(self, client: OSCARClient, context: OSCARContext, message: SNACMessage) -> None:
self.logger.info('[Client] ICBM__EVIL_REQUEST')
self.logger.debug('[Client] ICBM__EVIL_REQUEST')
# u16 send as (0: as yourself, 1: anonymously), string08 who
send_as = message.read_u16()
@@ -211,7 +211,7 @@ class ICBMFoodgroup:
reply = SNACMessage(0x0004, 0x0009, 0x0000, message.request_id)
reply.write_u16(delta)
reply.write_u16(new_level)
self.logger.info('[Server] ICBM__EVIL_REPLY')
self.logger.debug('[Server] ICBM__EVIL_REPLY')
client.send_snac(reply)
@Subgroup(0x000B)
@@ -222,7 +222,7 @@ class ICBMFoodgroup:
channel = message.read_u16()
name = message.read_bytes(message.read_u8()).decode('latin-1')
rest = message.data
self.logger.info('[Client] ICBM__CLIENT_ERR to', name)
self.logger.debug('[Client] ICBM__CLIENT_ERR to', name)
target = names.resolve_user(context.backend, name)
if target is None or _blocks(context.backend, target, context.user):
@@ -239,7 +239,7 @@ class ICBMFoodgroup:
@Subgroup(0x0010)
def offline_retrieve(self, client: OSCARClient, context: OSCARContext, message: SNACMessage) -> None:
self.logger.info('[Client] ICBM__OFFLINE_RETRIEVE')
self.logger.debug('[Client] ICBM__OFFLINE_RETRIEVE')
# ICBM__OFFLINE_RETRIEVE_REPLY ends the batch; it has no body
deliver_stored_messages(client.ctrl, then = lambda: client.send_snac(SNACMessage(0x0004, 0x0017, 0x0000, message.request_id)))
@@ -250,16 +250,16 @@ class ICBMFoodgroup:
receiver = message.read_bytes(message.read_u8()).decode('latin-1')
event = message.read_u16()
self.logger.info('[Client] ICBM__CLIENT_EVENT')
self.logger.info('[Client] Receiver:', receiver, '| Event:', hex(event))
self.logger.debug('[Client] ICBM__CLIENT_EVENT')
self.logger.debug('[Client] Receiver:', receiver, '| Event:', hex(event))
if channel != ICBMChannel.AOLIM:
self.logger.info('[Client] Unsupported channel:', hex(channel))
self.logger.debug('[Client] Unsupported channel:', hex(channel))
return
receiver_user = names.resolve_user(context.backend, receiver)
if receiver_user is None:
self.logger.info('[Client] Unknown receiver:', receiver)
self.logger.debug('[Client] Unknown receiver:', receiver)
return
receiver_uuid = receiver_user.uuid
@@ -269,7 +269,7 @@ class ICBMFoodgroup:
elif event in (ICBMEvent.Finished, ICBMEvent.Typed, ICBMEvent.Closed):
msg_type = MessageType.TypingDone
else:
self.logger.info('[Client] Unknown event type:', hex(event))
self.logger.debug('[Client] Unknown event type:', hex(event))
return
# a typing notification only goes to a conversation that's already there
@@ -317,7 +317,7 @@ class _Send:
receiver = self.receiver.encode('latin-1', errors = 'replace')
ack.write_u8(len(receiver))
ack.write_bytes(receiver)
self.client.ctrl.logger.info('[Server] ICBM__HOST_ACK')
self.client.ctrl.logger.debug('[Server] ICBM__HOST_ACK')
self.client.send_snac(ack)
def text(self, plain: str, html: str, *, icq: Optional[Tuple[int, int, str]] = None) -> None:
@@ -347,7 +347,7 @@ class _Send:
self.error(ICBMError.NotLoggedOn)
return
except Exception as ex:
ctrl.logger.info('[Client] Could not create private chat:', str(ex))
ctrl.logger.debug('[Client] Could not create private chat:', str(ex))
self.error(ICBMError.NotLoggedOn)
return