Add extra logging for Frontier Auth, especially via edmc://

This commit is contained in:
Athanasius committed 2021-04-01 14:45:51 +01:00
1 parent 74afcb085a
commit baa86b4fbf
1 file changed
+4
+4
View File
@@ -48,6 +48,7 @@ class GenericProtocolHandler:
self.lastpayload = url
if not config.shutting_down:
logger.debug('event_generate("<<CompanionAuthEvent>>"')
self.master.event_generate('<<CompanionAuthEvent>>', when="tail")
@@ -289,6 +290,7 @@ elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine a
msg = MSG()
# Calls GetMessageW: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessagew
while GetMessageW(byref(msg), None, 0, 0) != 0:
logger.trace(f'DDE message of type: {msg.message}')
if msg.message == WM_DDE_EXECUTE:
# GlobalLock does some sort of "please dont move this?"
# https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-globallock
@@ -296,8 +298,10 @@ elif sys.platform == 'win32' and getattr(sys, 'frozen', False) and not is_wine a
GlobalUnlock(msg.lParam) # Unlocks the GlobalLock-ed object
if args.lower().startswith('open("') and args.endswith('")'):
logger.trace(f'args are: {args}')
url = urllib.parse.unquote(args[6:-2]).strip()
if url.startswith(self.redirect):
logger.debug(f'Message starts with {self.redirect}')
self.event(url)
SetForegroundWindow(GetParent(self.master.winfo_id())) # raise app window