Represents a single public chat message within the system. More...
Header: | #include <ChatMessagePayload> |
|
ChatMessagePayload(const QJsonObject &json) | |
QDateTime | authoredAt() const |
int | cacheId() const |
QString | channel() const |
int | id() const |
QString | message() const |
QString | ownerId() const |
void | setAuthoredAt(const QDateTime &datetime) |
void | setCacheId(int id) |
void | setChannel(const QString &channel) |
void | setId(int id) |
void | setMessage(const QString &message) |
void | setOwnerId(const QString &id) |
void | setUsername(const QString &name) |
QString | username() const |
ChatMessagePayload encapsulates the properties of a chat message, including sender info, channel name, message body, and timestamp. It can be initialized from a QJsonObject and is exposed to QML via Q_GADGET and QML_VALUE_TYPE.
Returns the timestamp when the message was authored.
Access functions:
QDateTime | authoredAt() const |
void | setAuthoredAt(const QDateTime &datetime) |
Returns the optional client-side cache ID.
Access functions:
int | cacheId() const |
void | setCacheId(int id) |
Returns the name of the channel this message was posted in.
Access functions:
QString | channel() const |
void | setChannel(const QString &channel) |
Returns the server-assigned unique ID for the message.
Access functions:
int | id() const |
void | setId(int id) |
Returns the body text of the chat message.
Access functions:
QString | message() const |
void | setMessage(const QString &message) |
Returns the user ID of the message sender.
Access functions:
QString | ownerId() const |
void | setOwnerId(const QString &id) |
Returns the sender's username name.
Access functions:
QString | username() const |
void | setUsername(const QString &name) |
[explicit]
ChatMessagePayload::ChatMessagePayload(const QJsonObject &json)Constructs a ChatMessagePayload from a json object.
Sets the authored timestamp to datetime.
datetime is the time the message was authored
Note: Setter function for property authoredAt.
See also authoredAt().
Sets the cache ID to id.
id is the message's unique cache id
Note: Setter function for property cacheId.
See also cacheId().
Sets the message's channel to channel.
channel is the channel's name
Note: Setter function for property channel.
See also channel().
Sets the unique message ID to id.
id is the messages unique id
Note: Setter function for property id.
See also id().
Sets the message body text to message.
message is the string of text that represents the message content
Note: Setter function for property message.
See also message().
Sets the sender's user ID to id.
id is the sender's unique user id
Note: Setter function for property ownerId.
See also ownerId().
Sets the sender's display name to name.
name is the senders username
Note: Setter function for property username.
See also username().