User Connections 0.1.0: Follows, mutual connections and blocking as a module
User Connections 0.1.0 is the first release of the social relationships module, moved out of PhoenixKit core into its own package: people can follow each other, form mutual connections and block users.
Three kinds of relationship
- Follows are one-way and need no approval.
- Connections are mutual: one person sends a request and the other accepts or rejects it. If both people have sent each other a request, the connection is accepted at once.
- Blocks are one-way. Blocking someone removes any follows and connections between the two, and a blocked pair cannot follow or connect. A block can carry a reason.
Nobody can follow, connect with or block themselves. Every follow, connection and block action is also written to a history table.
Admin page
The admin Connections page, under the modules group, shows Statistics (follows, connections, pending requests and blocks), the Enable Connections Module switch under Module Configuration, and a short Relationship Types explanation. Access is controlled by the Connections permission.
My Connections
Signed-in users get a My Connections page at /profile/connections with tabs for Followers, Following, Connections, Requests and Blocked, each with a count. From there they unfollow, accept or reject requests, cancel the ones they sent, remove connections and unblock users.
For a profile page of your own, the module’s functions give the relationship between two users and the follower, following and connection counts.
Upgrading
Add {:phoenix_kit_user_connections, "~> 0.1.0"} to your dependencies. It needs PhoenixKit 1.7 and is found by PhoenixKit at startup with no further configuration. The module uses the tables PhoenixKit core already creates.
User Connections 0.1.0. Install or update: {:phoenix_kit_user_connections, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.