Skip to content

User-related Features

  • Admin API path: /users. For specific API details, please refer to the OpenAPI documentation
  • Client Interface: Please refer to the UserServiceController class
  • The underlying request model: please refer to the interface description file in the https://github.com/turms-im/proto/tree/master/request/user directory
  • Configuration class: im.turms.server.common.infra.property.env.service.business.user.UserProperties

User information function

FunctionFunction DescriptionRelated Configuration
Add Userturms.service.user.activate-user-when-added
Delete Userturms.service.user.delete-user-logically
Modify user profileUsers modify their own nickname, introduction, avatar URL
Get user profileUser view own or other user's profile
Set user profile access permissionsUsers can set access permissions for each personal profile. Access rights are: visible to everyone, visible to friends, visible only to yourself
User roleAdministrators can assign different roles to usersConfiguration model: im.turms.service.domain.user.po.UserRole

User Relationship Hosting

concept:

  • Relationship: Relationship is divided into one-way relationship and two-way relationship. One-way relationship refers to: the owner of the relationship (relationship owner) has a specific relationship with the Related User (relationship person), such as "one-way friend" (allowing the other party to send messages and friend requests) or "blocking User" (prohibit the other party from sending messages, friend requests, etc.). The establishment of a one-way relationship does not require permission authentication. A two-way relationship means that user A has a one-way relationship with user B, and user B has a one-way relationship with user A. For example, user A blocks user B, and user B can specify not to block user A.
  • Related Users: Refers to users who have a one-way or two-way relationship (designate the other party as a friend or block the user). Two users are Strangers if they don't have a relationship of either kind.
  • Relational person group: A relational person group consists of a group name and a group of related persons, and each relationship must exist in at least one related person group. If the client does not perform a group operation on the relationship when creating the relationship, the relationship will be put into the user's default relationship group. Therefore, special attention should be paid to the fact that there can be both "friends" and "blocked" users in "a related person group". Of course, you can restrict a group to only have a certain type of related person through business restrictions.

Additional supplement: In fact, there is no such concept as "friend/block user" in the Turms domain model, and its essence is a bool called "isBlocked".

Function
Function DescriptionRelated Configuration
Get relationshipGet the relationship owned by the current user according to optional filtering (such as specifying user ID, "whether it is a contact", "whether it is a friend/blocked user", etc.) and grouping conditions
Add a relationship (+initiate a friend request)①If adding a relationship as a "friend", according to your customized Turms server configuration, the user can either directly add a "friend" relationship, or initiate a friend request first , the operation of adding a "friend" relationship will not be performed automatically until the requestee's approval is obtained.
② If you add a related person whose relationship is "block user", no approval is required and it will take effect directly. Users will no longer receive any messages or requests from blocked users.
turms.service.user.friend-request.content-limit
turms.service.user.friend-request.delete-expired-requests-when-cron-triggered
turms.service.user.friend -request.allow-send-request-after-declined-or-ignored-or-expired
turms.service.user.friend-request.friend-request-expire-after-seconds
turms.service .user.friend-request.expired-user-friend-requests-cleanup-cron
turms.service.user.friend-request.delete-expired-requests-when-cron-triggered
Approve/Reject Friend RequestUser can approve or reject friend request. If you agree to the friend request, the two will establish a two-way "friend" relationship
Delete RelationAccording to the optional deletion conditions (such as "is/is not a relation", "is a friend/block user"), delete a certain type of relation or a designated relation.deleteTwoSidedRelationships
Modify the relationship with related partiesModify user relationship (friend/block user) information. When modifying the relationship to "friend", you need to send a friend request by default (you can cancel this step)
Create relational person groupWhen creating a group, you can specify the group name and the relational person to be added at the same time. The same person can be added to multiple groups
Delete related groupDelete the related group, and you can choose whether to transfer the related people in the deleted related group to other groups (if not specified, it will be assigned to "default group" by default)
Rename Relationship GroupRename Relationship Group
Obtain the user's own related person group informationGet the user's own related person group information
Add a relation to a groupAdd/move a relation to a relation group. If the group does not exist, the operation fails
Delete a related person from a groupDelete a related person from a related person group

GPS

Configuration class: im.turms.server.common.infra.property.env.common.location.LocationProperties

FunctionFunction DescriptionRelated Configuration
User location recordPeriodically record user locationturms.location.enabled
turms.location.treat-user-id-and-device-type-as-unique-user
People NearbySearch for other nearby users based on current real-time coordinatesturms.location.users-nearby-request.default-max-available-nearby-users-number
turms.location.users-nearby-request. default-max-distance-meters
turms.location.users-nearby-request.max-available-users-nearby-number-limit
turms.location.users-nearby-request.max-distance- meters

Statistics function

Configuration class: im.turms.server.common.infra.property.env.service.env.StatisticsProperties

Although Turms provides some basic statistical functions, it is recommended that users collect various statistical data through cloud services, such as Amazon CloudWatch.

FunctionFunction DescriptionRelated Configuration
Online user statisticsThe Master node in the Turms cluster will regularly record the number of online users in the cluster in the form of logsturms.service.statistics.log-online-users-number
turms.service.statistics. online-users-number-logging-cron