Class ChatMessage
A normal chat message.
Namespace: TehGM.Wolfringo.Messages
Assembly: Wolfringo.Core.dll
Syntax
[ResponseType(typeof(ChatResponse))]
public class ChatMessage : IChatMessage, IWolfMessage, IRawDataMessage
Remarks
Uses ChatResponse as response type.
Constructors
| Improve this Doc View SourceChatMessage()
Creates a message instance.
Declaration
[JsonConstructor]
protected ChatMessage()
ChatMessage(UInt32, Boolean, String, IEnumerable<Byte>)
Creates a message instance.
Declaration
public ChatMessage(uint recipientID, bool groupMessage, string type, IEnumerable<byte> data)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | recipientID | User or group ID to send the message to. |
Boolean | groupMessage | Is recipient a group? |
String | type | Mime type of the message. |
IEnumerable<Byte> | data | Raw byte data of the message. |
Properties
| Improve this Doc View SourceEditInfo
Information about message's latest edit.
Declaration
[JsonProperty("edited", NullValueHandling = NullValueHandling.Ignore)]
public ChatMessage.EditMetadata? EditInfo { get; }
Property Value
Type | Description |
---|---|
Nullable<ChatMessage.EditMetadata> |
EventName
Message event name.
Declaration
[JsonIgnore]
public string EventName { get; }
Property Value
Type | Description |
---|---|
String |
Remarks
Equals to MessageSend.
FlightID
WOLF protocol internal flight ID.
Declaration
public string FlightID { get; }
Property Value
Type | Description |
---|---|
String |
HasTips
Is this message tipped?
Declaration
[JsonProperty("isTipped", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public bool HasTips { get; }
Property Value
Type | Description |
---|---|
Boolean |
ID
Unique ID of the message.
Declaration
[Obsolete("WOLF protocol now prefers to use Timestamp as a message ID.")]
public Guid? ID { get; }
Property Value
Type | Description |
---|---|
Nullable<Guid> |
Remarks
WOLF seems to prefer using Timestamp as message identifier now. Please use this to identify the message.
IsDeleted
Is this message soft-deleted by group admin?
Declaration
[JsonProperty("isDeleted", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsGroupMessage
Is it a group message?
Declaration
public bool IsGroupMessage { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsImage
Is it an image message?
Declaration
[JsonIgnore]
public bool IsImage { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsPrivateMessage
Is it a private message?
Declaration
[JsonIgnore]
public bool IsPrivateMessage { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsText
Is it a text message?
Declaration
[JsonIgnore]
public bool IsText { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsVoice
Is it a voice message?
Declaration
[JsonIgnore]
public bool IsVoice { get; }
Property Value
Type | Description |
---|---|
Boolean |
MimeType
Type of the message.
Declaration
public string MimeType { get; }
Property Value
Type | Description |
---|---|
String |
RawData
Message's raw binary data.
Declaration
[JsonIgnore]
public IReadOnlyCollection<byte> RawData { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<Byte> |
RecipientID
User or group that received the message.
Declaration
public uint RecipientID { get; }
Property Value
Type | Description |
---|---|
UInt32 |
SenderID
User that sent the message.
Declaration
public uint? SenderID { get; }
Property Value
Type | Description |
---|---|
Nullable<UInt32> |
Remarks
When creating a new chat message, this value will be null.
For received messages, this value will be populated normally.
Text
Message's text.
Declaration
[JsonIgnore]
public string Text { get; }
Property Value
Type | Description |
---|---|
String |
Timestamp
Message's timestamp.
Declaration
public WolfTimestamp? Timestamp { get; }
Property Value
Type | Description |
---|---|
Nullable<WolfTimestamp> |
Remarks
When creating a new chat message, this value will be null. Once WOLF server acknowledges the message, it'll respond with timestamp value. Default WolfClient implementation will automatically populate this value once this happens, so message will have timestamp populated after SendAsync<TResponse>(IWolfMessage, CancellationToken) returns.
For received messages, this value will be populated normally.