Sendbird Chat SDK for .NET  3.0.29
SendBird.BaseMessage Class Reference
Inheritance diagram for SendBird.BaseMessage:
SendBird.AdminMessage SendBird.FileMessage SendBird.UserMessage

Classes

class  SendingStatus
 

Public Types

enum  MentionType { USERS, CHANNEL }
 

Public Member Functions

Sender GetSender ()
 
override string ToString ()
 
void SetSendingStatus (SendingStatus sendingStatus)
 
bool IsOpenChannel ()
 
bool IsGroupChannel ()
 
virtual byte[] Serialize ()
 

Static Public Member Functions

static bool BelongsTo (BaseMessage message, string userId)
 
static bool EqualsIgnoreCase (string userId, string anotherString)
 
static bool BelongsTo (BaseMessage message, User user)
 
static string Base64Decode (string data)
 
static byte[] Base64Encode (string data)
 
static BaseMessage BuildFromSerializedData (byte[] data)
 

Properties

abstract string RequestId [get]
 
abstract string Message [get]
 
SendingStatus GetSendingStatus [get]
 
string UserId [get]
 
long MessageId [get]
 
long CreatedAt [get]
 
long UpdatedAt [get]
 
string ChannelUrl [get]
 
string Data [get]
 
string CustomType [get]
 
List< UserMentionedUsers [get]
 
List< string > MentionedUserIds [get]
 
long RootMessageId [get]
 
long ParentMessageId [get]
 
BaseMessageParams.MentionType GetMentionType [get]
 
bool IsOperatorMessage [get]
 
bool IsSilent [get]
 
bool ShouldForceUpdateLastMessage [get]
 

Detailed Description

Base class for messages.

Member Enumeration Documentation

◆ MentionType

Mention type.

Since
3.0.15

Member Function Documentation

◆ BelongsTo() [1/2]

static bool SendBird.BaseMessage.BelongsTo ( BaseMessage  message,
string  userId 
)
inlinestatic

Checks whether the sender's userId of the BaseMessage equals the given user's id.

Parameters
messageBaseMessage to check user.
userUser to check. Returns false if user is null.
Returns
whether the message is sent by the user with userId. Returns false if user or message is null. 2020.7

◆ BelongsTo() [2/2]

static bool SendBird.BaseMessage.BelongsTo ( BaseMessage  message,
User  user 
)
inlinestatic

Checks whether the sender's userId of the BaseMessage equals the given user's id.

Parameters
messageBaseMessage to check user.
userUser to check. Returns false if user is null.
Returns
whether the message is sent by the user with userId. Returns false if user or message is null. 2020.7

◆ BuildFromSerializedData()

static BaseMessage SendBird.BaseMessage.BuildFromSerializedData ( byte[]  data)
inlinestatic

Builds UserMessage, FileMessage or AdminMessage instance from serialized data generated by serialize().

Parameters
dataSerialized UserMessage, FileMessage or AdminMessage data.
Returns
UserMessage, FileMessage or AdminMessage instance.
Since
3.0.17

◆ GetSender()

Sender SendBird.BaseMessage.GetSender ( )
inline

Returns sender of message. If SendBird.Options#useMemberAsMessageSender(boolean) is set true, the sender information such as nickname and profile url is returned as the same with the channel member's. Otherwise, the sender information will be returned as the value of the message creation time.

Returns
The sender.

◆ IsGroupChannel()

bool SendBird.BaseMessage.IsGroupChannel ( )
inline

Checks if this message is from GroupChannel.

Returns
True if the message is from GroupChannel.

◆ IsOpenChannel()

bool SendBird.BaseMessage.IsOpenChannel ( )
inline

Checks if this message is from OpenChannel.

Returns
True if the message is from OpenChannel.

◆ Serialize()

virtual byte [] SendBird.BaseMessage.Serialize ( )
inlinevirtual

Serializes the UserMessage, FileMessage or AdminMessage instance. This byte array can be stored in the database in your application. The instance can be restored by buildFromSerializedData(byte[]).

Returns
Serialized UserMessage, FileMessage or AdminMessage data.
Since
3.0.17

◆ SetSendingStatus()

void SendBird.BaseMessage.SetSendingStatus ( SendingStatus  sendingStatus)
inline

Returns sender of message. If SendBird.Options#useMemberAsMessageSender(boolean) is set true, the sender information such as nickname and profile url is returned as the same with the channel member's. Otherwise, the sender information will be returned as the value of the message creation time.

Returns
The sender.

Property Documentation

◆ ChannelUrl

string SendBird.BaseMessage.ChannelUrl
get

Returns the channel URL of this message belongs to.

Returns
Channel URL.

◆ CreatedAt

long SendBird.BaseMessage.CreatedAt
get

Returns message creation time.

Returns
Timestamp in milliseconds.

◆ CustomType

string SendBird.BaseMessage.CustomType
get

Returns the custom type of message.

Returns
Custom type.
Since
3.0.18

◆ Data

string SendBird.BaseMessage.Data
get

Returns message custom data.

Returns
The data.

◆ GetMentionType

BaseMessageParams.MentionType SendBird.BaseMessage.GetMentionType
get

Returns mention type. Refer to BaseMessageParams.MentionType.

Returns
Mention type.
Since
3.0.17

◆ GetSendingStatus

SendingStatus SendBird.BaseMessage.GetSendingStatus
get

Returns message sending status.

Returns
Message sending status (refer to SendingStatus).
Since
3.0.16

◆ IsOperatorMessage

bool SendBird.BaseMessage.IsOperatorMessage
get

Returns boolean value that can be used to test if the message was sent from an operator.

This value is true if the sender of this message was an operator at the moment this message was sent.

Note that Sender#getRole() returns the role of the sender at the current moment (when the server response was sent). So if the sender's operator status changed after sending a message, the value returned by this method and the result of

Sender::getRole() == Member.Role.OPERATOR

might differ.

Returns
true if the sender of the message was an operator at the moment the message was sent, false otherwise.
See also
Sender::getRole()
Since
3.0.20

◆ IsSilent

bool SendBird.BaseMessage.IsSilent
get

Checks whether the message is silent or not.

Returns
Returns true if the message is silent.
Since
3.0.26

◆ MentionedUsers

List<User> SendBird.BaseMessage.MentionedUsers
get

Returns mentioned users.

Returns
Mentioned users.
Since
3.0.17

◆ Message

abstract string SendBird.BaseMessage.Message
get

Returns message text.

Returns
The text.

◆ MessageId

long SendBird.BaseMessage.MessageId
get

Returns message ID.

Returns
The ID.

◆ ParentMessageId

long SendBird.BaseMessage.ParentMessageId
get

Returns the parent message's ID if this is a child message.

Returns
The parent message's ID.
Since
3.0.17

◆ RequestId

abstract string SendBird.BaseMessage.RequestId
get

Returns a message request ID.

Returns
String ID.

◆ RootMessageId

long SendBird.BaseMessage.RootMessageId
get

Returns the root message's ID if this is a thread message.

Returns
The root message's ID.
Since
3.0.17

◆ UpdatedAt

long SendBird.BaseMessage.UpdatedAt
get

Returns message updated time.

Returns
Timestamp in milliseconds.
Since
3.0.16

◆ UserId

string SendBird.BaseMessage.UserId
get

Returns message UserId.

Returns
The UserId.
Since
3.0.15

The documentation for this class was generated from the following file: