Skip to content
Friendship plugin ala facebook
JavaScript Smarty CSS
Branch: master
Clone or download
Latest commit f540400 Oct 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
less hide follow button with css instead of js Mar 6, 2015
lib fix plugin Oct 3, 2019
public closes #7 Dec 15, 2015
.gitignore first pass Mar 2, 2015
.jshintrc update jshint Sep 13, 2016
LICENSE
README.md
index.js added library.js Mar 2, 2015
package.json 1.2.2 Oct 3, 2019
plugin.json

README.md

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.

Optional

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}">Remove Friend</button>
<!-- ELSE -->
<button class="btn btn-warning friend-button" data-uid="{users.uid}" data-type="friend" data-username="{users.username}">Add Friend</button>
<!-- ENDIF users.isFriends -->

Integration with Write API

If you have the Write API Plugin installed, the following routes are exposed for you to use:

  • /friends/:uid
    • GET /
      • Retrieves all friendship-related data pertaining to the user specified via uid, including pending friendship data
      • Can only be called by an administrative account
    • POST /
      • Requests a friendship from user specified via userslug, or accepts a pending friendship, if one is outstanding
      • Accepts: Nothing
    • DELETE /
      • Unfriends the user specified via uid (relative to the calling user), or rejects a friendship request, if one is outstanding
      • Accepts: Nothing
You can’t perform that action at this time.