Debian Codegraph @

event/accountdata.go

raw
1 // Copyright (c) 2020 Tulir Asokan
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 package event
8
9 import (
10 "encoding/json"
11
12 "maunium.net/go/mautrix/id"
13 )
14
15 // TagEventContent represents the content of a m.tag room account data event.
16 // https://spec.matrix.org/v1.2/client-server-api/#mtag
17 type TagEventContent struct {
18 Tags Tags `json:"tags"`
19 }
20
21 type Tags map[string]Tag
22
23 type Tag struct {
24 Order json.Number `json:"order,omitempty"`
25 }
26
27 // DirectChatsEventContent represents the content of a m.direct account data event.
28 // https://spec.matrix.org/v1.2/client-server-api/#mdirect
29 type DirectChatsEventContent map[id.UserID][]id.RoomID
30
31 // FullyReadEventContent represents the content of a m.fully_read account data event.
32 // https://spec.matrix.org/v1.2/client-server-api/#mfully_read
33 type FullyReadEventContent struct {
34 EventID id.EventID `json:"event_id"`
35 }
36
37 // IgnoredUserListEventContent represents the content of a m.ignored_user_list account data event.
38 // https://spec.matrix.org/v1.2/client-server-api/#mignored_user_list
39 type IgnoredUserListEventContent struct {
40 IgnoredUsers map[id.UserID]IgnoredUser `json:"ignored_users"`
41 }
42
43 type IgnoredUser struct {
44 // This is an empty object
45 }