nodebb-plugin-session-sharing
nodebb-plugin-session-sharing copied to clipboard
User's "picture" isn't used
Hi all,
Not sure if my setup is incorrect or if this is really the case, but it appears as though the picture
property in the supplied user data isn't used anywhere. When I set the value, I didn't see a new user's picture/avatar being set to what I provided, so I dug into the code and it looks like the NodeBB core doesn't read the picture
value passed into the data
object of User.create
:
var userData = {
'username': data.username,
'userslug': data.userslug,
'email': data.email,
'joindate': timestamp,
'lastonline': timestamp,
'picture': '',
'fullname': data.fullname || '',
'location': '',
'birthday': '',
'website': '',
'signature': '',
'uploadedpicture': '',
'profileviews': 0,
'reputation': 0,
'postcount': 0,
'topiccount': 0,
'lastposttime': 0,
'banned': 0,
'status': 'online'
};
I'd also like the ability to set things like the location
, website
and joindate
because I have these values for a lot of users on my primary login's account system already.
Would it make sense to edit the plugin to allow these values in the payload and then after the create call, update the profile with whatever other values we have available? The concept would be similar to @Gacnt's pull request, but would occur during user creation instead.
In case anybody else wants to implement an extension like this, I created a fork to fit my needs. Here are the main changes: https://github.com/alecananian/nodebb-plugin-session-sharing-extended/commit/7a7dff18abb633fd03ecee65a3646ef1fefd0b6d