mirror of
https://git.ugnet.gay/CrossTalk/azul.git
synced 2026-11-25 08:30:04 +00:00
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:
1 parent
4bf878556b
commit
6451bb9426
46 files changed
+307
-541
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user