feat: fire outbound PluginMessage for each notification
Closes #826
diff would be much smaller if we could use reflection but c'est la vie
This might get tricky once we support url-specific notifier settings, but we'll cross that bridge when we get there
This is looking really promising! My only concern is that certain metadata aren't included in the outbound PluginMessage, which some external plugins might want to use. These are the following:
"content": "Text message as set by the user", "playerName": "your rsn", "accountType": "NORMAL | IRONMAN | HARDCORE_IRONMAN", "seasonalWorld": "true | false", "dinkAccountHash": "abcdefghijklmnopqrstuvwxyz1234abcdefghijklmnopqrstuvwxyz", (probably not necessary) "embeds": [] (should be excluded, unique to Discord)
"clanName": "Dink QA", "groupIronClanName": "Dink QA", "discordUser": { (should be excluded, unique to Discord) "id": "012345678910111213", "name": "Gamer", "avatarHash": "abc123def345abc123def345abc123de" }, "world": 518, "regionId": 12850
Also massive thanks for adding this feature! It has certainly saved me a ton of work :)
I did some testing with this branch of Dink, trying to process the data with my own plugin. I believe certain data fields still require sanitizing to allow other plugins to process the data easily. For example, I let Dink fire the death notificiation and the value of the "location" field from the death notifier is not in json format: (regionId=12342, plane=0, instanced=false). Similarly, the fields "keptItem" and "lostItems" have the same issue. I was able to get this result by using Gson to read the data from the PluginMessage sent by Dink.
I suspect that this is also the case for many other fields from other notifiers that are custom java objects.
I did some testing with this branch of Dink, trying to process the data with my own plugin. I believe certain data fields still require sanitizing to allow other plugins to process the data easily. For example, I let Dink fire the death notificiation and the value of the "location" field from the death notifier is not in json format: (regionId=12342, plane=0, instanced=false). Similarly, the fields "keptItem" and "lostItems" have the same issue. I was able to get this result by using Gson to read the data from the PluginMessage sent by Dink.
I suspect that this is also the case for many other fields from other notifiers that are custom java objects.
The data within PluginMessage isn't exactly in json format, it's a Map<String, Object> where sometimes the object value is another Map<String, Object> (as for location) or even a Collection<Map<String, Object>> (as for kept/lost items)