$ cnpm install nodebb-plugin-friends
Friendship plugin ala facebook
Replaces the default follow mechanic (ala Twitter) with a moderated friending system which allows users to approve/deny friend requests.
If you want a friends button in the /users list, add the following in partials/users_list.tpl
<!-- IF users.isFriends -->
<button class="btn btn-link friend-button" data-uid="{users.uid}" data-type="unfriend" data-username="{users.username}">[[plugin-friends:action.remove-friend]]</button>
<!-- ELSE -->
<button class="btn btn-warning friend-button" data-uid="{users.uid}" data-type="friend" data-username="{users.username}">[[plugin-friends:action.add-friend]]</button>
<!-- ENDIF users.isFriends -->
If you have the Write API Plugin installed, the following routes are exposed for you to use:
/friends/:uid
GET /
uid
, including pending friendship dataPOST /
userslug
, or accepts a pending friendship, if one is outstandingDELETE /
uid
(relative to the calling user), or rejects a friendship request, if one is outstandingCopyright © npmmirror.com | 浙ICP备15033595号-63 |