| .idea | ||
| gradle/wrapper | ||
| src/main/java/de/kentoj/socialprototype | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
TODO
- encryption for event data
-
Terminology
| term | definition |
|---|---|
| handle | full username like u.alice@example.com |
| field-pair | a key-value pair like localUsername=alice |
-
Protocol decisions
-
field-names
Fields are to be sorted alphabetically. The
type-field, which is required at every event, must be the first field.To allow filtering messages(for example to ignore all messages by a specific user), some order is declared:
-
the
type-field is the first field -
the
username-field(if used) is the second one -
short names
As type, username and content are used heavily and field-names are sent in the payload, we declare the shortname
tfor type,ufor localUsername andcfor content respectively.
-
-
Events
Everything is an event. Like in the matrix protocol.
-
Payload
Payload is a bytearray with length-prefixed field-pairs. The payload is terminated with a 0-byte Strings are generally UTF-8 encoded.
e.g
1t3msg1u5alice7c12Hello World!\0:typeis "msg"sender(localUsername) is "alice"contentis "Hello World!"
(If you're confused, see the
short namessection)
-