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

+19 -19
View File
@@ -113,7 +113,7 @@ class BackendEventHandler(event.BackendEventHandler):
self.ctrl = ctrl
def on_maintenance_message(self, *args: Any, **kwargs: Any) -> None:
self.ctrl.logger.info("on_maintenance message dispatched")
self.ctrl.logger.debug("on_maintenance message dispatched")
message = "CrossTalk will be down for maintenance soon. Now is a good time to wrap up any conversations."
if args[1] is not None and args[1] > 0:
message = """CrossTalk will be down for maintenance in around {} minute(s). \
@@ -121,7 +121,7 @@ Now is a good time to wrap up any conversations.""".format(args[1])
self.ctrl.send_snac(popup_display(self, "https://crosstalk.im/maintenance", message))
def on_client_alert(self, alert: Alert) -> bool:
self.ctrl.logger.info("on_client_alert dispatched")
self.ctrl.logger.debug("on_client_alert dispatched")
self.ctrl.send_snac(popup_display(self, alert.url or '', alert.plain()))
return True
@@ -147,10 +147,10 @@ Now is a good time to wrap up any conversations.""".format(args[1])
send_status_on_bl: bool = False, sess_id: Optional[int] = None,
updated_phone_info: Optional[Dict[str, Any]] = None,
) -> None:
self.ctrl.logger.info('on_presence_notification dispatched')
self.ctrl.logger.info('update_status:', update_status)
self.ctrl.logger.info('update_info_other:', update_info_other)
self.ctrl.logger.info('status:', ctc.status.substatus.name)
self.ctrl.logger.debug('on_presence_notification dispatched')
self.ctrl.logger.debug('update_status:', update_status)
self.ctrl.logger.debug('update_info_other:', update_info_other)
self.ctrl.logger.debug('status:', ctc.status.substatus.name)
# don't want updates from users with invalid usernames
if not names.representable(ctc.head):
@@ -158,7 +158,7 @@ Now is a good time to wrap up any conversations.""".format(args[1])
# don't want any non-status updates
if not update_status:
self.ctrl.logger.info('fell into update_status check')
self.ctrl.logger.debug('fell into update_status check')
return
# presence only starts flowing once the client says it's ready for it (OSERVICE__CLIENT_READY), and only for
@@ -169,21 +169,21 @@ Now is a good time to wrap up any conversations.""".format(args[1])
try:
ctc.compute_visible_status(self.bs.user)
self.ctrl.logger.info('sending presence notif')
self.ctrl.logger.debug('sending presence notif')
self.ctrl.send_snac(build_presence_notif(ctc, self.ctrl.backend, self.bs))
except Exception as ex:
self.ctrl.logger.error(ex)
def on_presence_self_notification(self, old_substatus: Substatus, *, update_status: bool = True,
update_info: bool = True) -> None:
self.ctrl.logger.info('on_presence_self_notification')
self.ctrl.logger.debug('on_presence_self_notification')
pass
def on_chat_invite(
self, chat: Chat, inviter: User, *, circle: bool = False, inviter_id: Optional[str] = None,
invite_msg: str = '',
) -> None:
self.ctrl.logger.info('on_chat_invite')
self.ctrl.logger.debug('on_chat_invite')
if chat is None:
chat = self.ctrl.backend.chat_create()
chat.add_id('oscar0', chat.ids['main'])
@@ -199,12 +199,12 @@ Now is a good time to wrap up any conversations.""".format(args[1])
return
def on_declined_chat_invite(self, chat: Chat, circle: bool = False) -> None:
self.ctrl.logger.info('on_declined_chat_invite')
self.ctrl.logger.debug('on_declined_chat_invite')
pass
def on_added_me(self, user: User, *, adder_id: Optional[str] = None,
message: Optional[TextWithData] = None) -> None:
self.ctrl.logger.info('on_added_me')
self.ctrl.logger.debug('on_added_me')
if not names.representable(user):
return
@@ -222,23 +222,23 @@ Now is a good time to wrap up any conversations.""".format(args[1])
send_icq_system_message(self.ctrl, user, ICQMessageType.Added, '')
def on_removed_me(self, user: User) -> None:
self.ctrl.logger.info('on_removed_me')
self.ctrl.logger.debug('on_removed_me')
pass
def on_contact_request_denied(self, user_added: User, message: Optional[str], *,
contact_id: Optional[str] = None) -> None:
self.ctrl.logger.info('on_contact_request_denied')
self.ctrl.logger.debug('on_contact_request_denied')
pass
def on_oim_sent(self, oim: OIM) -> None:
self.ctrl.logger.info('on_oim_sent')
self.ctrl.logger.debug('on_oim_sent')
# an offline message only gets stored while its recipient can't be reached, so a session that hears about one
# (signed on invisible, say) gets it straight away, like the YMSG frontend does
from ..foodgroups.icbm import deliver_offline_messages
deliver_offline_messages(self.ctrl, [oim])
def on_login_elsewhere(self, option: LoginOption) -> None:
self.ctrl.logger.info('on_login_elsewhere')
self.ctrl.logger.debug('on_login_elsewhere')
self.ctrl.signoff(DISCONNECT_NEW_LOGIN)
self.ctrl.close()
return
@@ -304,16 +304,16 @@ def login(logger: Logger,
if error_code is None and user.suspended:
error_code = LoginError.Suspended
logger.info(screen_name, 'tried to sign on but is suspended!')
logger.debug(screen_name, 'tried to sign on but is suspended!')
# and check if the user has verified their e-mail address
#if error_code is None and not user.verified_to_login:
# error_code = LoginError.EmailNotVerified
#
# logger.info(screen_name, 'tried to sign on but has not verified their e-mail address!')
# logger.debug(screen_name, 'tried to sign on but has not verified their e-mail address!')
if error_code is None:
logger.info(screen_name, 'signed on successfully!')
logger.debug(screen_name, 'signed on successfully!')
# generate BOS cookie and add it to array
client_id_tlv = find_tlv(tlvs, 0x0003)
+8 -8
View File
@@ -26,7 +26,7 @@ class ChatEventHandler(event.ChatEventHandler):
self._pending = []
def on_participant_joined(self, cs_other: 'ChatSession', first_pop: bool, initial_join: bool) -> None:
self.ctrl.logger.info('on_participant_joined')
self.ctrl.logger.debug('on_participant_joined')
still_pending = []
for (target_uuid, data) in self._pending:
if cs_other.user.uuid == target_uuid:
@@ -36,7 +36,7 @@ class ChatEventHandler(event.ChatEventHandler):
self._pending = still_pending
def on_participant_left(self, cs_other: 'ChatSession', last_pop: bool) -> None:
self.ctrl.logger.info('on_participant_left')
self.ctrl.logger.debug('on_participant_left')
# once the other side is gone this chat can't reach them again (they'd be invited to a new one), so it's let go
if any(cs is not self.cs for cs in self.cs.chat.get_roster()):
return
@@ -49,17 +49,17 @@ class ChatEventHandler(event.ChatEventHandler):
def on_chat_invite_declined(self, chat: 'Chat', invitee: User, *, invitee_id: Optional[str] = None,
message: Optional[str] = None, circle: bool = False) -> None:
self.ctrl.logger.info('on_chat_invite_declined')
self.ctrl.logger.debug('on_chat_invite_declined')
def on_chat_updated(self) -> None:
self.ctrl.logger.info('on_chat_updated')
self.ctrl.logger.debug('on_chat_updated')
def on_chat_roster_updated(self) -> None:
self.ctrl.logger.info('on_chat_roster_updated')
self.ctrl.logger.debug('on_chat_roster_updated')
def on_participant_status_updated(self, cs_other: 'ChatSession', first_pop: bool, initial: bool,
old_substatus: Substatus) -> None:
self.ctrl.logger.info('on_participant_status_updated')
self.ctrl.logger.debug('on_participant_status_updated')
def on_message(self, data: MessageData) -> None:
if data.sender is self.bs.user:
@@ -72,8 +72,8 @@ class ChatEventHandler(event.ChatEventHandler):
self.ctrl.send_snac(messagedata_to_icbm_event(data, self.bs))
return
elif data.type is MessageType.Chat:
self.ctrl.logger.info('Got a message from', data.sender.username, 'saying:')
self.ctrl.logger.info((data.text or '').encode())
self.ctrl.logger.debug('Got a message from', data.sender.username, 'saying:')
self.ctrl.logger.debug((data.text or '').encode())
# an OSCAR sender's own message cookie travels with the message, so acks and replies line up on both ends; anything
# else gets a fresh one, since clients take a repeated cookie for a repeated message
self.ctrl.send_snac(messagedata_to_icbm(data.front_cache.get('icbm_cookie') or gen_cookie(), data, self.bs))