matrix.capnp (3959B)
1 @0xeab570afa44bcb9d; 2 3 struct MessageEvent { 4 content: union { 5 text: group { 6 body @0: Text; 7 # Format is optional 8 format @1: Text; 9 formattedBody @2: Text; 10 } 11 emote: group { 12 body @3: Text; 13 # Format is optional 14 format @4: Text; 15 formattedBody @5: Text; 16 } 17 notice: group { 18 body @6: Text; 19 # Format is optional 20 format @7: Text; 21 formattedBody @8: Text; 22 } 23 audio: group { 24 body @9: Text; 25 info @10: AudioInfo; 26 url @11: Text; 27 } 28 file: group { 29 body @12: Text; 30 filename @13: Text; 31 info @14: FileInfo; 32 url @15: Text; 33 } 34 image: group { 35 body @16: Text; 36 info @17: ImageInfo; 37 url @18: Text; 38 # File only exists if e2ee encrypted 39 file @19: Text; 40 } 41 location: group { 42 body @20: Text; 43 geoUri @21: Text; 44 # Info can be null 45 info @22: LocationInfo; 46 } 47 video: group { 48 body @23: Text; 49 info @24: VideoInfo; 50 url @25: Text; 51 } 52 serverNotice : group { 53 adminContact @26: Text; 54 body @27: VideoInfo; 55 limitType @28: LimitType; 56 serverNoticeType @29: ServerNoticeType; 57 } 58 } 59 roomId @30: Text; 60 sender @31: Text; 61 eventId @32: Text; 62 originServerTs @33: UInt64; 63 unsigned @34: Unsigned; 64 65 enum ServerNoticeType { 66 usageLimitExceeded @0; 67 } 68 69 enum LimitType { 70 montlyActiveUser @0; 71 } 72 73 struct AudioInfo { 74 duration @0: UInt64; 75 mimeType @1: Text; 76 size @2: UInt64; 77 } 78 79 struct FileInfo { 80 mimeType @0: Text; 81 size @1: UInt64; 82 } 83 84 struct LocationInfo { 85 # Only present if image thumbnail is set 86 thumbnailInfo @0: ThumbnailInfo; 87 # Only present if image thumbnail is set 88 thumbnailUrl @1: Text; 89 # Only exists on E2EE encrypted messages 90 # Only present if image thumbnail is set 91 thumbnailFile @2: Text; 92 } 93 94 struct VideoInfo { 95 duration @0: UInt64; 96 h @1: UInt64; 97 w @2: UInt64; 98 size @3: UInt64; 99 mimeType @4: Text; 100 # Only exists on E2EE encrypted messages 101 # Only present if image thumbnail is set 102 thumbnailFile @5: Text; 103 # Only present if image thumbnail is set 104 thumbnailInfo @6: ThumbnailInfo; 105 # Only present if image thumbnail is set 106 thumbnailUrl @7: Text; 107 } 108 } 109 110 struct RoomNameEvent { 111 name @0: Text; 112 roomId @1: Text; 113 sender @2: Text; 114 eventId @3: Text; 115 originServerTs @4: UInt64; 116 unsigned @5: Unsigned; 117 } 118 119 struct RoomTopicEvent { 120 topic @0: Text; 121 roomId @1: Text; 122 sender @2: Text; 123 eventId @3: Text; 124 originServerTs @4: UInt64; 125 unsigned @5: Unsigned; 126 } 127 128 struct RoomAvatarEvent { 129 avatarUrl @0: Text; 130 avatarInfo @1: ImageInfo; 131 roomId @2: Text; 132 sender @3: Text; 133 eventId @4: Text; 134 originServerTs @5: UInt64; 135 unsigned @6: Unsigned; 136 } 137 138 struct Unsigned(Content) { 139 age @0: UInt64; 140 transactionId @1: Text; 141 # Not present if first event of type 142 prevContent @2: Content; 143 # Not present if not redacted 144 redactedBecause @3: Text; 145 } 146 147 struct ImageInfo { 148 mimeType @0: Text; 149 # Only exists on E2EE encrypted messages 150 # Only present if image thumbnail is set 151 thumbnailFile @1: Text; 152 # Only present if image thumbnail is set 153 thumbnailInfo @2: ThumbnailInfo; 154 # Only present if image thumbnail is set 155 thumbnailUrl @3: Text; 156 size @4: UInt64; 157 h @5: UInt64; 158 w @6: UInt64; 159 } 160 161 struct ThumbnailInfo { 162 mimeType @0: Text; 163 size @4: UInt64; 164 h @5: UInt64; 165 w @6: UInt64; 166 }