Skip to content
Snippets Groups Projects
Verified Commit e9d2b3fb authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Add conditional serialization information

parent a2980edd
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ type whose network representation they borrow here:
|BufferId | `Int` |
|IdentityId | `Int` |
|NetworkId | `Int` |
|MsgId | `Long` |
|MsgId | `Int` |
|PeerPtr | `Long` |
|IrcUser | `QVariantMap` |
|IrcChannel | `QVariantMap` |
......@@ -26,6 +26,10 @@ type whose network representation they borrow here:
|NetworkInfo | `QVariantMap` |
|Network::Server| `QVariantMap` |
MsgId’s serialization changes depending on which features are available on both
client and server. Specifically, if "LongMessageId" is available, it is
serialized as long, and its values can go above INT_MAX.
## String
Strings are serialized as a signed int of the length in bytes plus their content
......@@ -113,15 +117,33 @@ for each key a `QString` for the key and a `Variant` for each element.
## Message
|Type |Field |Description |
|------------|---------|--------------------------------------------------------------------------------------------|
|`Int` |messageId|The unique, sequential id for the message |
|------------|--------------|----------------------------------------------------------------------------------------------------|
|`MsgId` |messageId |The unique, sequential id for the message |
|`Int` |timestamp |The timestamp of the message in UNIX time (32-bit, seconds) |
|`Long` | |**CONDITIONAL**: Different Type (Long) if LongTime feature is enabled |
|`Int` |type |See below |
|`UChar` |flags |See below |
|`BufferInfo`|buffer |The buffer the message belongs to, usually everything but BufferId is set to `NULL` |
|`QByteArray`|sender |(UTF-8) The sender as `nick!ident@host` |
|`QByteArray`|senderPrefixes|(UTF-8) The prefix modes of the sender |
| | |**CONDITIONAL**: Only serialized if SenderPrefixes feature is enabled |
|`QByteArray`|realName |(UTF-8) The realName of the sender |
| | |**CONDITIONAL**: Only serialized if RichMessages feature is enabled |
|`QByteArray`|avatarUrl |(UTF-8) The avatarUrl of the sender, if available |
| | |**CONDITIONAL**: Only serialized if RichMessages feature is enabled |
|`QByteArray`|content |(UTF-8) The message content, already stripped from CTCP formatting, but containing mIRC format codes|
This type's serialization format depends heavily on the available features — if
both client and server support a certain feature, additional fields are added or
changed.
|Field |Feature |Effect |
|--------------|--------------|-----------------------------------------------------------------------|
|timestamp |LongTime |Type is Long instead of Int, content is milliseconds instead of seconds|
|senderPrefixes|SenderPrefixes|Field is serialized only with feature present |
|realName |RichMessages |Field is serialized only with feature present |
|avatarUrl |RichMessages |Field is serialized only with feature present |
### Type
|Enum |Value |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment