mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
plugin: Wrap custom notifications in a dict with additional origin
This should allow us to differentiate the origin of the notification, and further prevent plugins from spoofing native notifications.
This commit is contained in:
committed by
Rusty Russell
parent
cfb1107244
commit
62e3358a5b
@@ -6,8 +6,8 @@ plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.subscribe("custom")
|
||||
def on_custom_notification(val, plugin, **kwargs):
|
||||
plugin.log("Got a custom notification {}".format(val))
|
||||
def on_custom_notification(origin, payload, **kwargs):
|
||||
plugin.log("Got a custom notification {} from plugin {}".format(payload, origin))
|
||||
|
||||
|
||||
@plugin.method("emit")
|
||||
|
||||
Reference in New Issue
Block a user