Modify arguments of user:profileLinks hook
-
Hi,
I've opened an issue on github in order to add some info to the user:profileLinks hook.
Modify data arguments when firing filter:user.profileLinks · Issue #4665 · NodeBB/NodeBB
I think would be nice to extend the arguments when firing the hook and add the callerUID and the uid of the user profiled thats being loaded. It would be nice to have that that in the filter in order to manage the profile links in the fi...
GitHub (github.com)
Just opened this thread to discuss it. It is related to this question: https://community.nodebb.org/topic/8810/i18n-client-side-user-profile-links-manipulation
-
Just tried the changes and i realized that theres only 1 argument for the data to the hook, so the change is not so compatible with existing plugins.
Think the change would involve just passing this data:
var data ={}; data.links = []; data.userData = {}; data.userData.callerUID= callerUID; data.userData.profileUID= uid; plugins.fireHook('filter:user.profileLinks', data, next);
(obviously better coded) In:
- list itemhttps://github.com/NodeBB/NodeBB/blob/master/src/controllers/accounts/helpers.js#L145
- list itemhttps://github.com/NodeBB/NodeBB/blob/master/src/controllers/accounts/helpers.js#L42
That way if theres needed to send more info in the future, the object can be used for that
instead of using the array directly wich IMHO limitating a bunch of possible functionality right now.What are your thoughts? @3rd-Party-Developers @administrators
Regards.
-
@baris said in Modify arguments of user:profileLinks hook:
Yeah it's a breaking change since we have to change it to an object and include more info.
So is it unlikely to happen, or what is the approach you're following regarding this kind of requests? Thanks in advance.