File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ class WinRTDesktopNotifier(DesktopNotifierBase):
6969
7070 DEFAULT_ACTION = "default"
7171 REPLY_ACTION = "action=reply&"
72+ BUTTON_ACTION_PREFIX = "action=button&id="
7273 REPLY_TEXTBOX_NAME = "textBox"
7374
7475 def __init__ (
@@ -185,7 +186,7 @@ async def _send(
185186 {
186187 "content" : button .title ,
187188 "activationType" : "background" ,
188- "arguments" : str (n ),
189+ "arguments" : WinRTDesktopNotifier . BUTTON_ACTION_PREFIX + str (n ),
189190 },
190191 )
191192
@@ -217,8 +218,11 @@ def on_activated(sender, boxed_activated_args) -> None: # type:ignore
217218 ]
218219 text = unbox_winrt (boxed_text )
219220 notification .reply_field .on_replied (text )
220- elif action_id .isnumeric ():
221- action_number = int (action_id )
221+ elif action_id .startswith (WinRTDesktopNotifier .BUTTON_ACTION_PREFIX ):
222+ action_number_str = action_id .replace (
223+ WinRTDesktopNotifier .BUTTON_ACTION_PREFIX , ""
224+ )
225+ action_number = int (action_number_str )
222226 callback = notification .buttons [action_number ].on_pressed
223227 if callback :
224228 callback ()
You can’t perform that action at this time.
0 commit comments