- One-way relationships where User A follows User B without requiring consent. - Similar to Twitter/Instagram follows. -
-- Two-way mutual relationships that require acceptance from both parties. - Similar to LinkedIn connections or Facebook friends. -
-- Prevents all interaction between users. Blocking removes any existing - follows and connections between the users. -
-- The Connections module provides a public API that parent applications can use - to integrate social features into their own views and components. -
- -alias PhoenixKit.Modules.Connections
-
- Follows
- Connections.follow(current_user, target_user)
- Connections.following?(current_user, target_user)
- Connections.list_followers(user)
-
- Connections
- Connections.request_connection(user_a, user_b)
- Connections.connected?(user_a, user_b)
-
- Full relationship status
- Connections.get_relationship(user_a, user_b)
- No followers yet
-{follow.follower.email}
-- Followed you <.time_ago datetime={follow.inserted_at} /> -
-You're not following anyone yet
-{follow.followed.email}
-- Following since <.time_ago datetime={follow.inserted_at} /> -
-No connections yet
-{other_user.email}
-- Connected <.time_ago datetime={connection.responded_at} /> -
-No pending requests
-{request.requester.email}
-- Requested <.time_ago datetime={request.requested_at} /> -
-No pending outgoing requests
-{request.recipient.email}
-- Sent <.time_ago datetime={request.requested_at} /> -
-No blocked users
-{block.blocked.email}
-- Blocked <.time_ago datetime={block.inserted_at} /> -
- <%= if block.reason do %> -Reason: {block.reason}
- <% end %> -