SIGN UP

ConversationParticipant

Class that represents a participant of the conversation.

In order to apply changes made by setters, you have to call one of the following methods:

The default permissions for all participants are: write / edit / remove their own messages.

The creator of any conversation by default:

Constructors

ConversationParticipant

 ConversationParticipant(long imUserId)

Create a new participant with default permissions.

Use ConversationConfig.ConversationConfigBuilder.setParticipants(List) or IConversation.addParticipants(List, IMessengerCompletionHandler) to add participants to the conversation.

Parameters

Methods

canEditAllMessages

boolean canEditAllMessages()

Check if the conversation participant can edit messages other than its own.

Returns

  • Return:

    boolean

canEditMessages

boolean canEditMessages()

Check if the conversation participant can edit its own messages.

Once a participant is created, it's true by default.

Returns

  • Return:

    boolean

canManageParticipants

boolean canManageParticipants()

Check if the participant can manage other participants in the conversation:

  • add / remove / edit permissions
  • add / remove participants

If true and isOwner is true, the participant can manage other owners.

Returns

  • Return:

    boolean

    True if user can manage conversation participants, false otherwise

canRemoveAllMessages

boolean canRemoveAllMessages()

Check if the conversation participant can remove messages other than its own.

Returns

  • Return:

    boolean

canRemoveMessages

boolean canRemoveMessages()

Check if the conversation participant can remove its own messages.

Once a participant is created, it's true by default.

Returns

  • Return:

    boolean

canWrite

boolean canWrite()

Check if the conversation participant can send messages to the conversation.

Once a participant is created, it's true by default.

Returns

  • Return:

    boolean

    True if user can write to the conversation, false otherwise

getIMUserId

long getIMUserId()

Get the IM user id.

Returns

  • Return:

    long

getLastReadEventSequence

long getLastReadEventSequence()

Get the sequence of the event that was last marked as read. Participants mark events as read via IConversation.markAsRead(long, IMessengerCompletionHandler).

The method returns the sequence of the last read event in a conversation or 0, if the participant didn't mark events as read.

Returns

  • Return:

    long

isOwner

boolean isOwner()

Check if the conversation participant is an owner.

There could be more than one owner in the conversation.

If true, the participant can edit the conversation. If true and canManageParticipants is true, the participant can manage other owners.

Returns

  • Return:

    boolean

setCanEditAllMessages

ConversationParticipant setCanEditAllMessages(boolean canEditAllMessages)

Specify if the participant can edit messages other than its own.

It could be set only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

If the user that calls this method has both canManageParticipants and isOwner permissions, it can edit other owners.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canEditAllMessages:

    boolean

Returns

setCanEditMessages

ConversationParticipant setCanEditMessages(boolean canEditMessages)

Specify if the participant can edit its own messages in the conversation.

The permission is given by default.

It could be changed only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

If the user that calls this method has both canManageParticipants and isOwner permissions, it can edit other owners.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canEditMessages:

    boolean

Returns

setCanManageParticipants

ConversationParticipant setCanManageParticipants(boolean canManageParticipants)

Specify if the conversation participant can manage other participants in the conversation:

  • add, remove and edit permissions
  • add and remove participants

It could be set only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

If the user that calls this method has both canManageParticipants and isOwner permissions, it can edit other owners.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canManageParticipants:

    boolean

Returns

setCanRemoveAllMessages

ConversationParticipant setCanRemoveAllMessages(boolean canRemoveAllMessages)

Specify if the participant can remove messages other than its own.

It could be set only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

If the user that calls this method has both canManageParticipants and isOwner permissions, it can edit other owners.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canRemoveAllMessages:

    boolean

Returns

setCanRemoveMessages

ConversationParticipant setCanRemoveMessages(boolean canRemoveMessages)

Specify if the participant can remove its own messages in the conversation.

The permission is given by default.

It could be changed only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

If the user that calls this method has both canManageParticipants and isOwner permissions, it can edit other owners.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canRemoveMessages:

    boolean

Returns

setCanWrite

ConversationParticipant setCanWrite(boolean canWrite)

Specify if the participant can write in the conversation.

The permission is given by default.

It could be changed only if the user that calls this method has the ConversationParticipant.canManageParticipants() permission.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • canWrite:

    boolean

Returns

setOwner

ConversationParticipant setOwner(boolean isOwner)

Specify if the conversation participant is the owner.

It could be set only if the user that calls this method has the ConversationParticipant.canManageParticipants() and ConversationParticipant.isOwner() permissions.

Note that a method call doesn't apply changes by itself; there are appropriate methods for applying:

Parameters

  • isOwner:

    boolean

Returns