matrix_sdk_test/test_json/sync.rs
1//! Complete sync responses.
2
3use once_cell::sync::Lazy;
4use ruma::{room_id, RoomId};
5use serde_json::{json, Value as JsonValue};
6
7use crate::DEFAULT_TEST_ROOM_ID;
8
9pub static SYNC: Lazy<JsonValue> = Lazy::new(|| {
10 json!({
11 "device_one_time_keys_count": {},
12 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
13 "device_lists": {
14 "changed": [
15 "@example:example.org"
16 ],
17 "left": []
18 },
19 "account_data": {
20 "events": [
21 {
22 "content": {
23 "ignored_users": {
24 "@someone:example.org": {}
25 }
26 },
27 "type": "m.ignored_user_list"
28 }
29 ]
30 },
31 "rooms": {
32 "invite": {},
33 "join": {
34 *DEFAULT_TEST_ROOM_ID: {
35 "summary": {},
36 "account_data": {
37 "events": [
38 {
39 "content": {
40 "event_id": "$someplace:example.org"
41 },
42 "room_id": "!roomid:room.com",
43 "type": "m.fully_read"
44 }
45 ]
46 },
47 "ephemeral": {
48 "events": [
49 {
50 "content": {
51 "$151680659217152dPKjd:localhost": {
52 "m.read": {
53 "@example:localhost": {
54 "ts": 151680989
55 }
56 }
57 }
58 },
59 "room_id": *DEFAULT_TEST_ROOM_ID,
60 "type": "m.receipt"
61 },
62 ]
63 },
64 "state": {
65 "events": [
66 {
67 "content": {
68 "join_rule": "public"
69 },
70 "event_id": "$15139375514WsgmR:localhost",
71 "origin_server_ts": 151393755000000_u64,
72 "sender": "@example:localhost",
73 "state_key": "",
74 "type": "m.room.join_rules",
75 "unsigned": {
76 "age": 7034220
77 }
78 },
79 {
80 "content": {
81 "avatar_url": null,
82 "displayname": "example",
83 "membership": "join"
84 },
85 "event_id": "$151800140517rfvjc:localhost",
86 "membership": "join",
87 "origin_server_ts": 151800140000000_u64,
88 "sender": "@example:localhost",
89 "state_key": "@example:localhost",
90 "type": "m.room.member",
91 "unsigned": {
92 "age": 2970366,
93 "replaces_state": "$151800111315tsynI:localhost"
94 }
95 },
96 {
97 "content": {
98 "history_visibility": "shared"
99 },
100 "event_id": "$15139375515VaJEY:localhost",
101 "origin_server_ts": 151393755000000_u64,
102 "sender": "@example:localhost",
103 "state_key": "",
104 "type": "m.room.history_visibility",
105 "unsigned": {
106 "age": 7034220
107 }
108 },
109 {
110 "content": {
111 "creator": "@example:localhost"
112 },
113 "event_id": "$15139375510KUZHi:localhost",
114 "origin_server_ts": 151393755000000_u64,
115 "sender": "@example:localhost",
116 "state_key": "",
117 "type": "m.room.create",
118 "unsigned": {
119 "age": 703422
120 }
121 },
122 {
123 "content": {
124 "aliases": [
125 "#tutorial:localhost"
126 ]
127 },
128 "event_id": "$15139375516NUgtD:localhost",
129 "origin_server_ts": 151393755000000_u64,
130 "sender": "@example:localhost",
131 "state_key": "localhost",
132 "type": "m.room.aliases",
133 "unsigned": {
134 "age": 703422
135 }
136 },
137 {
138 "content": {
139 "topic": "room topic"
140 },
141 "event_id": "$151957878228ssqrJ:localhost",
142 "origin_server_ts": 151957878000000_u64,
143 "sender": "@example:localhost",
144 "state_key": "",
145 "type": "m.room.topic",
146 "unsigned": {
147 "age": 1392989709,
148 "prev_content": {
149 "topic": "test"
150 },
151 "prev_sender": "@example:localhost",
152 "replaces_state": "$151957069225EVYKm:localhost"
153 }
154 },
155 {
156 "content": {
157 "ban": 50,
158 "events": {
159 "m.room.avatar": 50,
160 "m.room.canonical_alias": 50,
161 "m.room.history_visibility": 100,
162 "m.room.name": 50,
163 "m.room.power_levels": 100
164 },
165 "events_default": 0,
166 "invite": 0,
167 "kick": 50,
168 "redact": 50,
169 "state_default": 50,
170 "users": {
171 "@example:localhost": 100
172 },
173 "users_default": 0
174 },
175 "event_id": "$15139375512JaHAW:localhost",
176 "origin_server_ts": 151393755000000_u64,
177 "sender": "@example:localhost",
178 "state_key": "",
179 "type": "m.room.power_levels",
180 "unsigned": {
181 "age": 703422
182 }
183 },
184 {
185 "content": {
186 "alias": "#tutorial:localhost"
187 },
188 "event_id": "$15139375513VdeRF:localhost",
189 "origin_server_ts": 151393755000000_u64,
190 "sender": "@example:localhost",
191 "state_key": "",
192 "type": "m.room.canonical_alias",
193 "unsigned": {
194 "age": 703422
195 }
196 },
197 {
198 "content": {
199 "avatar_url": null,
200 "displayname": "example2",
201 "membership": "join"
202 },
203 "event_id": "$152034824468gOeNB:localhost",
204 "membership": "join",
205 "origin_server_ts": 152034824000000_u64,
206 "sender": "@example2:localhost",
207 "state_key": "@example2:localhost",
208 "type": "m.room.member",
209 "unsigned": {
210 "age": 623527289,
211 "prev_content": {
212 "membership": "leave"
213 },
214 "prev_sender": "@example:localhost",
215 "replaces_state": "$152034819067QWJxM:localhost"
216 }
217 },
218 ]
219 },
220 "timeline": {
221 "events": [
222 {
223 "content": {
224 "body": "baba",
225 "format": "org.matrix.custom.html",
226 "formatted_body": "<strong>baba</strong>",
227 "msgtype": "m.text"
228 },
229 "event_id": "$152037280074GZeOm:localhost",
230 "origin_server_ts": 152037280000000_u64,
231 "sender": "@example:localhost",
232 "type": "m.room.message",
233 "unsigned": {
234 "age": 598971425
235 }
236 }
237 ],
238 "limited": true,
239 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
240 },
241 "unread_notifications": {
242 "highlight_count": 0,
243 "notification_count": 11
244 }
245 }
246 },
247 "leave": {}
248 },
249 "to_device": {
250 "events": []
251 },
252 "presence": {
253 "events": [
254 {
255 "content": {
256 "avatar_url": "mxc://localhost/wefuiwegh8742w",
257 "currently_active": false,
258 "last_active_ago": 1,
259 "presence": "online",
260 "status_msg": "Making cupcakes"
261 },
262 "sender": "@example:localhost",
263 "type": "m.presence"
264 }
265 ]
266 }
267 })
268});
269
270pub static DEFAULT_SYNC_SUMMARY: Lazy<JsonValue> = Lazy::new(|| {
271 json!({
272 "device_one_time_keys_count": {},
273 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
274 "device_lists": {
275 "changed": [
276 "@example:example.org"
277 ],
278 "left": []
279 },
280 "rooms": {
281 "invite": {},
282 "join": {
283 *DEFAULT_TEST_ROOM_ID: {
284 "summary": {
285 "m.heroes": [
286 "@example2:localhost"
287 ],
288 "m.joined_member_count": 2,
289 "m.invited_member_count": 0
290 },
291 "account_data": {
292 "events": [
293 {
294 "content": {
295 "ignored_users": {
296 "@someone:example.org": {}
297 }
298 },
299 "type": "m.ignored_user_list"
300 }
301 ]
302 },
303 "ephemeral": {
304 "events": [
305 {
306 "content": {
307 "$151680659217152dPKjd:localhost": {
308 "m.read": {
309 "@example:localhost": {
310 "ts": 151680989
311 }
312 }
313 }
314 },
315 "type": "m.receipt"
316 },
317 {
318 "content": {
319 "event_id": "$someplace:example.org"
320 },
321 "room_id": "!roomid:room.com",
322 "type": "m.fully_read"
323 }
324 ]
325 },
326 "state": {
327 "events": [
328 {
329 "content": {
330 "join_rule": "public"
331 },
332 "event_id": "$15139375514WsgmR:localhost",
333 "origin_server_ts": 151393755000000_u64,
334 "sender": "@example:localhost",
335 "state_key": "",
336 "type": "m.room.join_rules",
337 "unsigned": {
338 "age": 7034220
339 }
340 },
341 {
342 "content": {
343 "avatar_url": null,
344 "displayname": "example",
345 "membership": "join"
346 },
347 "event_id": "$151800140517rfvjc:localhost",
348 "membership": "join",
349 "origin_server_ts": 151800140000000_u64,
350 "sender": "@example:localhost",
351 "state_key": "@example:localhost",
352 "type": "m.room.member",
353 "unsigned": {
354 "age": 297036,
355 "replaces_state": "$151800111315tsynI:localhost"
356 }
357 },
358 {
359 "content": {
360 "history_visibility": "shared"
361 },
362 "event_id": "$15139375515VaJEY:localhost",
363 "origin_server_ts": 151393755000000_u64,
364 "sender": "@example:localhost",
365 "state_key": "",
366 "type": "m.room.history_visibility",
367 "unsigned": {
368 "age": 703422
369 }
370 },
371 {
372 "content": {
373 "creator": "@example:localhost"
374 },
375 "event_id": "$15139375510KUZHi:localhost",
376 "origin_server_ts": 151393755000000_u64,
377 "sender": "@example:localhost",
378 "state_key": "",
379 "type": "m.room.create",
380 "unsigned": {
381 "age": 703422
382 }
383 },
384 {
385 "content": {
386 "topic": "room topic"
387 },
388 "event_id": "$151957878228ssqrJ:localhost",
389 "origin_server_ts": 151957878000000_u64,
390 "sender": "@example:localhost",
391 "state_key": "",
392 "type": "m.room.topic",
393 "unsigned": {
394 "age": 1392989709,
395 "prev_content": {
396 "topic": "test"
397 },
398 "prev_sender": "@example:localhost",
399 "replaces_state": "$151957069225EVYKm:localhost"
400 }
401 },
402 {
403 "content": {
404 "ban": 50,
405 "events": {
406 "m.room.avatar": 50,
407 "m.room.canonical_alias": 50,
408 "m.room.history_visibility": 100,
409 "m.room.name": 50,
410 "m.room.power_levels": 100
411 },
412 "events_default": 0,
413 "invite": 0,
414 "kick": 50,
415 "redact": 50,
416 "state_default": 50,
417 "users": {
418 "@example:localhost": 100
419 },
420 "users_default": 0
421 },
422 "event_id": "$15139375512JaHAW:localhost",
423 "origin_server_ts": 151393755000000_u64,
424 "sender": "@example:localhost",
425 "state_key": "",
426 "type": "m.room.power_levels",
427 "unsigned": {
428 "age": 703422
429 }
430 },
431 {
432 "content": {
433 "avatar_url": null,
434 "displayname": "example2",
435 "membership": "join"
436 },
437 "event_id": "$152034824468gOeNB:localhost",
438 "membership": "join",
439 "origin_server_ts": 152034824000000_u64,
440 "sender": "@example2:localhost",
441 "state_key": "@example2:localhost",
442 "type": "m.room.member",
443 "unsigned": {
444 "age": 623527289,
445 "prev_content": {
446 "membership": "leave"
447 },
448 "prev_sender": "@example:localhost",
449 "replaces_state": "$152034819067QWJxM:localhost"
450 }
451 },
452 {
453 "content": {
454 "membership": "leave",
455 "reason": "offline",
456 "avatar_url": "avatar.com",
457 "displayname": "example"
458 },
459 "event_id": "$1585345508297748AIUBh:matrix.org",
460 "origin_server_ts": 158534550000000_u64,
461 "sender": "@example:localhost",
462 "state_key": "@example:localhost",
463 "type": "m.room.member",
464 "unsigned": {
465 "replaces_state": "$1585345354296486IGZfp:localhost",
466 "prev_content": {
467 "avatar_url": "avatar.com",
468 "displayname": "example",
469 "membership": "join"
470 },
471 "prev_sender": "@example2:localhost",
472 "age": 6992
473 },
474 "room_id": "!roomid:room.com"
475 }
476 ]
477 },
478 "timeline": {
479 "events": [
480 {
481 "content": {
482 "body": "baba",
483 "format": "org.matrix.custom.html",
484 "formatted_body": "<strong>baba</strong>",
485 "msgtype": "m.text"
486 },
487 "event_id": "$152037280074GZeOm:localhost",
488 "origin_server_ts": 152037280000000_u64,
489 "sender": "@example:localhost",
490 "type": "m.room.message",
491 "unsigned": {
492 "age": 598971425
493 }
494 }
495 ],
496 "limited": true,
497 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
498 },
499 "unread_notifications": {
500 "highlight_count": 0,
501 "notification_count": 11
502 }
503 }
504 },
505 "leave": {}
506 },
507 "to_device": {
508 "events": []
509 },
510 "presence": {
511 "events": [
512 {
513 "content": {
514 "avatar_url": "mxc://localhost/wefuiwegh8742w",
515 "currently_active": false,
516 "last_active_ago": 1,
517 "presence": "online",
518 "status_msg": "Making cupcakes"
519 },
520 "sender": "@example:localhost",
521 "type": "m.presence"
522 }
523 ]
524 }
525 })
526});
527
528pub static MORE_SYNC: Lazy<JsonValue> = Lazy::new(|| {
529 json!({
530 "device_one_time_keys_count": {},
531 "next_batch": "s526_47314_0_7_1_1_1_11444_2",
532 "device_lists": {
533 "changed": [
534 "@example:example.org"
535 ],
536 "left": []
537 },
538 "rooms": {
539 "invite": {},
540 "join": {
541 *DEFAULT_TEST_ROOM_ID: {
542 "summary": {},
543 "account_data": {
544 "events": []
545 },
546 "ephemeral": {
547 "events": [
548 {
549 "content": {
550 "$151680659217152dPKjd:localhost": {
551 "m.read": {
552 "@example:localhost": {
553 "ts": 151680989
554 }
555 }
556 }
557 },
558 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
559 "type": "m.receipt"
560 },
561 {
562 "content": {
563 "user_ids": [
564 "@alice:matrix.org",
565 "@bob:example.com"
566 ]
567 },
568 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
569 "type": "m.typing"
570 }
571 ]
572 },
573 "state": {
574 "events": []
575 },
576 "timeline": {
577 "events": [
578 {
579 "content": {
580 "body": "baba",
581 "format": "org.matrix.custom.html",
582 "formatted_body": "<strong>baba</strong>",
583 "msgtype": "m.text"
584 },
585 "event_id": "$152037280074GZeOm:localhost",
586 "origin_server_ts": 152037280000000_u64,
587 "sender": "@example:localhost",
588 "type": "m.room.message",
589 "unsigned": {
590 "age": 598971425
591 }
592 },
593 {
594 "content": {
595 "body": " * edited message",
596 "m.new_content": {
597 "body": "edited message",
598 "msgtype": "m.text"
599 },
600 "m.relates_to": {
601 "event_id": "$someeventid:localhost",
602 "rel_type": "m.replace"
603 },
604 "msgtype": "m.text"
605 },
606 "event_id": "$editevid:localhost",
607 "origin_server_ts": 159026265000000_u64,
608 "sender": "@alice:matrix.org",
609 "type": "m.room.message",
610 "unsigned": {
611 "age": 85
612 }
613 },
614 {
615 "content": {
616 "reason": "😀"
617 },
618 "event_id": "$151957878228ssqrJ:localhost",
619 "origin_server_ts": 151957878000000_u64,
620 "sender": "@example:localhost",
621 "type": "m.room.redaction",
622 "redacts": "$151957878228ssqrj:localhost",
623 "unsigned": {
624 "age": 85
625 }
626 },
627 {
628 "content": {},
629 "event_id": "$15275046980maRLj:localhost",
630 "origin_server_ts": 152750469000000_u64,
631 "sender": "@example:localhost",
632 "type": "m.room.message",
633 "unsigned": {
634 "age": 19334,
635 "redacted_because": {
636 "content": {},
637 "event_id": "$15275047031IXQRi:localhost",
638 "origin_server_ts": 152750470000000_u64,
639 "redacts": "$15275046980maRLj:localhost",
640 "sender": "@example:localhost",
641 "type": "m.room.redaction",
642 "unsigned": {
643 "age": 14523
644 }
645 },
646 "redacted_by": "$15275047031IXQRi:localhost"
647 }
648 },
649 {
650 "content": {
651 "m.relates_to": {
652 "event_id": "$15275047031IXQRi:localhost",
653 "key": "👍",
654 "rel_type": "m.annotation"
655 }
656 },
657 "event_id": "$15275047031IXQRi:localhost",
658 "origin_server_ts": 159027581000000_u64,
659 "sender": "@alice:matrix.org",
660 "type": "m.reaction",
661 "unsigned": {
662 "age": 85
663 }
664 },
665 {
666 "content": {
667 "body": "This is a notice",
668 "format": "org.matrix.custom.html",
669 "formatted_body": "<em>This is a notice</em>",
670 "msgtype": "m.notice"
671 },
672 "event_id": "$098237280074GZeOm:localhost",
673 "origin_server_ts": 162037280000000_u64,
674 "sender": "@bot:localhost",
675 "type": "m.room.message",
676 "unsigned": {
677 "age": 25
678 }
679 },
680 ],
681 "limited": false,
682 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
683 },
684 "unread_notifications": {
685 "highlight_count": 0,
686 "notification_count": 11
687 }
688 }
689 },
690 "leave": {}
691 },
692 "to_device": {
693 "events": []
694 },
695 "presence": {
696 "events": []
697 }
698 })
699});
700
701pub static MORE_SYNC_2: Lazy<JsonValue> = Lazy::new(|| {
702 json!({
703 "next_batch": "s526_47314_0_7_1_1_1_11444_3",
704 "rooms": {
705 "join": {
706 *DEFAULT_TEST_ROOM_ID: {
707 "timeline": {
708 "events": [
709 {
710 "content": {
711 "body": "baba",
712 "format": "org.matrix.custom.html",
713 "formatted_body": "<strong>baba</strong>",
714 "msgtype": "m.text"
715 },
716 "event_id": "$152037280074GZeOm2:localhost",
717 "origin_server_ts": 152037280000000_u64,
718 "sender": "@example:localhost",
719 "type": "m.room.message",
720 "unsigned": {
721 "age": 598971425
722 }
723 },
724 {
725 "content": {
726 "body": " * edited message",
727 "m.new_content": {
728 "body": "edited message",
729 "msgtype": "m.text"
730 },
731 "m.relates_to": {
732 "event_id": "$someeventid:localhost",
733 "rel_type": "m.replace"
734 },
735 "msgtype": "m.text"
736 },
737 "event_id": "$editevid2:localhost",
738 "origin_server_ts": 159026265000000_u64,
739 "sender": "@alice:matrix.org",
740 "type": "m.room.message",
741 "unsigned": {
742 "age": 85
743 }
744 },
745 {
746 "content": {
747 "reason": "😀"
748 },
749 "event_id": "$151957878228ssqrJ2:localhost",
750 "origin_server_ts": 151957878000000_u64,
751 "sender": "@example:localhost",
752 "type": "m.room.redaction",
753 "redacts": "$151957878228ssqrj:localhost",
754 "unsigned": {
755 "age": 85
756 }
757 },
758 {
759 "content": {},
760 "event_id": "$15275046980maRLj2:localhost",
761 "origin_server_ts": 152750469000000_u64,
762 "sender": "@example:localhost",
763 "type": "m.room.message",
764 "unsigned": {
765 "age": 19334,
766 "redacted_because": {
767 "content": {},
768 "event_id": "$15275047031IXQRi:localhost",
769 "origin_server_ts": 152750470000000_u64,
770 "redacts": "$15275046980maRLj:localhost",
771 "sender": "@example:localhost",
772 "type": "m.room.redaction",
773 "unsigned": {
774 "age": 14523
775 }
776 },
777 "redacted_by": "$15275047031IXQRi:localhost"
778 }
779 },
780 {
781 "content": {
782 "m.relates_to": {
783 "event_id": "$15275047031IXQRi:localhost",
784 "key": "👍",
785 "rel_type": "m.annotation"
786 }
787 },
788 "event_id": "$15275047031IXQRi2:localhost",
789 "origin_server_ts": 159027581000000_u64,
790 "sender": "@alice:matrix.org",
791 "type": "m.reaction",
792 "unsigned": {
793 "age": 85
794 }
795 },
796 {
797 "content": {
798 "body": "This is a notice",
799 "format": "org.matrix.custom.html",
800 "formatted_body": "<em>This is a notice</em>",
801 "msgtype": "m.notice"
802 },
803 "event_id": "$098237280074GZeOm2:localhost",
804 "origin_server_ts": 162037280000000_u64,
805 "sender": "@bot:localhost",
806 "type": "m.room.message",
807 "unsigned": {
808 "age": 25
809 }
810 },
811 ],
812 "limited": false,
813 "prev_batch": "s526_47314_0_7_1_1_1_11444_2"
814 },
815 "unread_notifications": {
816 "highlight_count": 0,
817 "notification_count": 11
818 }
819 }
820 },
821 },
822 })
823});
824
825pub static INVITE_SYNC: Lazy<JsonValue> = Lazy::new(|| {
826 json!({
827 "device_one_time_keys_count": {},
828 "next_batch": "s526_47314_0_7_1_1_1_11444_2",
829 "device_lists": {
830 "changed": [
831 "@example:example.org"
832 ],
833 "left": []
834 },
835 "rooms": {
836 "invite": {
837 "!696r7674:example.com": {
838 "invite_state": {
839 "events": [
840 {
841 "sender": "@alice:example.com",
842 "type": "m.room.name",
843 "state_key": "",
844 "content": {
845 "name": "My Room Name"
846 }
847 },
848 {
849 "sender": "@alice:example.com",
850 "type": "m.room.member",
851 "state_key": "@bob:example.com",
852 "content": {
853 "membership": "invite"
854 }
855 }
856 ]
857 }
858 }
859 },
860 "join": {},
861 "leave": {}
862 },
863 "to_device": {
864 "events": []
865 },
866 "presence": {
867 "events": [
868 {
869 "content": {
870 "avatar_url": "mxc://localhost/wefuiwegh8742w",
871 "currently_active": false,
872 "last_active_ago": 1,
873 "presence": "online",
874 "status_msg": "Making cupcakes"
875 },
876 "sender": "@example:localhost",
877 "type": "m.presence"
878 }
879 ]
880 }
881 })
882});
883
884pub static LEAVE_SYNC: Lazy<JsonValue> = Lazy::new(|| {
885 json!({
886 "device_one_time_keys_count": {},
887 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
888 "device_lists": {
889 "changed": [
890 "@example:example.org"
891 ],
892 "left": []
893 },
894 "account_data": {
895 "events": [
896 {
897 "content": {
898 "ignored_users": {
899 "@someone:example.org": {}
900 }
901 },
902 "type": "m.ignored_user_list"
903 }
904 ]
905 },
906 "rooms": {
907 "invite": {},
908 "join": {},
909 "leave": {
910 *DEFAULT_TEST_ROOM_ID: {
911 "summary": {},
912 "account_data": {
913 "events": []
914 },
915 "ephemeral": {
916 "events": [
917 {
918 "content": {
919 "$151680659217152dPKjd:localhost": {
920 "m.read": {
921 "@example:localhost": {
922 "ts": 151680989
923 }
924 }
925 }
926 },
927 "type": "m.receipt"
928 },
929 {
930 "content": {
931 "event_id": "$someplace:example.org"
932 },
933 "room_id": "!roomid:room.com",
934 "type": "m.fully_read"
935 }
936 ]
937 },
938 "state": {
939 "events": [
940 {
941 "content": {
942 "join_rule": "public"
943 },
944 "event_id": "$15139375514WsgmR:localhost",
945 "origin_server_ts": 151393755000000_u64,
946 "sender": "@example:localhost",
947 "state_key": "",
948 "type": "m.room.join_rules",
949 "unsigned": {
950 "age": 703422
951 }
952 },
953 {
954 "content": {
955 "avatar_url": null,
956 "displayname": "example",
957 "membership": "join"
958 },
959 "event_id": "$151800140517rfvjc:localhost",
960 "membership": "join",
961 "origin_server_ts": 151800140000000_u64,
962 "sender": "@example:localhost",
963 "state_key": "@example:localhost",
964 "type": "m.room.member",
965 "unsigned": {
966 "age": 297036,
967 "replaces_state": "$151800111315tsynI:localhost"
968 }
969 },
970 {
971 "content": {
972 "history_visibility": "shared"
973 },
974 "event_id": "$15139375515VaJEY:localhost",
975 "origin_server_ts": 151393755000000_u64,
976 "sender": "@example:localhost",
977 "state_key": "",
978 "type": "m.room.history_visibility",
979 "unsigned": {
980 "age": 703422
981 }
982 },
983 {
984 "content": {
985 "creator": "@example:localhost"
986 },
987 "event_id": "$15139375510KUZHi:localhost",
988 "origin_server_ts": 151393755000000_u64,
989 "sender": "@example:localhost",
990 "state_key": "",
991 "type": "m.room.create",
992 "unsigned": {
993 "age": 703422
994 }
995 },
996 {
997 "content": {
998 "aliases": [
999 "#tutorial:localhost"
1000 ]
1001 },
1002 "event_id": "$15139375516NUgtD:localhost",
1003 "origin_server_ts": 151393755000000_u64,
1004 "sender": "@example:localhost",
1005 "state_key": "localhost",
1006 "type": "m.room.aliases",
1007 "unsigned": {
1008 "age": 703422
1009 }
1010 },
1011 {
1012 "content": {
1013 "topic": "room topic"
1014 },
1015 "event_id": "$151957878228ssqrJ:localhost",
1016 "origin_server_ts": 151957878000000_u64,
1017 "sender": "@example:localhost",
1018 "state_key": "",
1019 "type": "m.room.topic",
1020 "unsigned": {
1021 "age": 1392989709,
1022 "prev_content": {
1023 "topic": "test"
1024 },
1025 "prev_sender": "@example:localhost",
1026 "replaces_state": "$151957069225EVYKm:localhost"
1027 }
1028 },
1029 {
1030 "content": {
1031 "ban": 50,
1032 "events": {
1033 "m.room.avatar": 50,
1034 "m.room.canonical_alias": 50,
1035 "m.room.history_visibility": 100,
1036 "m.room.name": 50,
1037 "m.room.power_levels": 100
1038 },
1039 "events_default": 0,
1040 "invite": 0,
1041 "kick": 50,
1042 "redact": 50,
1043 "state_default": 50,
1044 "users": {
1045 "@example:localhost": 100
1046 },
1047 "users_default": 0
1048 },
1049 "event_id": "$15139375512JaHAW:localhost",
1050 "origin_server_ts": 151393755000000_u64,
1051 "sender": "@example:localhost",
1052 "state_key": "",
1053 "type": "m.room.power_levels",
1054 "unsigned": {
1055 "age": 703422
1056 }
1057 },
1058 {
1059 "content": {
1060 "alias": "#tutorial:localhost"
1061 },
1062 "event_id": "$15139375513VdeRF:localhost",
1063 "origin_server_ts": 151393755000000_u64,
1064 "sender": "@example:localhost",
1065 "state_key": "",
1066 "type": "m.room.canonical_alias",
1067 "unsigned": {
1068 "age": 703422
1069 }
1070 },
1071 {
1072 "content": {
1073 "avatar_url": null,
1074 "displayname": "example2",
1075 "membership": "join"
1076 },
1077 "event_id": "$152034824468gOeNB:localhost",
1078 "membership": "join",
1079 "origin_server_ts": 152034824000000_u64,
1080 "sender": "@example2:localhost",
1081 "state_key": "@example2:localhost",
1082 "type": "m.room.member",
1083 "unsigned": {
1084 "age": 623527289,
1085 "prev_content": {
1086 "membership": "leave"
1087 },
1088 "prev_sender": "@example:localhost",
1089 "replaces_state": "$152034819067QWJxM:localhost"
1090 }
1091 },
1092 {
1093 "content": {
1094 "membership": "leave",
1095 "reason": "offline",
1096 "avatar_url": "mxc://avatar.com/ursn982srs2S",
1097 "displayname": "example"
1098 },
1099 "event_id": "$1585345508297748AIUBh:matrix.org",
1100 "origin_server_ts": 158534550000000_u64,
1101 "sender": "@example:localhost",
1102 "state_key": "@example:localhost",
1103 "type": "m.room.member",
1104 "unsigned": {
1105 "replaces_state": "$1585345354296486IGZfp:localhost",
1106 "prev_content": {
1107 "avatar_url": "mxc://avatar.com/ursn982srs2S",
1108 "displayname": "example",
1109 "membership": "join"
1110 },
1111 "prev_sender": "@example2:localhost",
1112 "age": 6992
1113 },
1114 "room_id": "!roomid:room.com"
1115 }
1116 ]
1117 },
1118 "timeline": {
1119 "events": [
1120 {
1121 "content": {
1122 "body": "baba",
1123 "format": "org.matrix.custom.html",
1124 "formatted_body": "<strong>baba</strong>",
1125 "msgtype": "m.text"
1126 },
1127 "event_id": "$152037280074GZeOm:localhost",
1128 "origin_server_ts": 152037280000000_u64,
1129 "sender": "@example:localhost",
1130 "type": "m.room.message",
1131 "unsigned": {
1132 "age": 598971425
1133 }
1134 }
1135 ],
1136 "limited": true,
1137 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
1138 },
1139 "unread_notifications": {
1140 "highlight_count": 0,
1141 "notification_count": 11
1142 }
1143 }
1144 }
1145 },
1146 "to_device": {
1147 "events": []
1148 },
1149 "presence": {
1150 "events": [
1151 {
1152 "content": {
1153 "avatar_url": "mxc://localhost/wefuiwegh8742w",
1154 "currently_active": false,
1155 "last_active_ago": 1,
1156 "presence": "online",
1157 "status_msg": "Making cupcakes"
1158 },
1159 "sender": "@example:localhost",
1160 "type": "m.presence"
1161 }
1162 ]
1163 }
1164 })
1165});
1166
1167pub static LEAVE_SYNC_EVENT: Lazy<JsonValue> = Lazy::new(|| {
1168 json!({
1169 "account_data": {
1170 "events": []
1171 },
1172 "to_device": {
1173 "events": []
1174 },
1175 "device_lists": {
1176 "changed": [],
1177 "left": []
1178 },
1179 "presence": {
1180 "events": []
1181 },
1182 "rooms": {
1183 "join": {},
1184 "invite": {},
1185 "leave": {
1186 *DEFAULT_TEST_ROOM_ID: {
1187 "timeline": {
1188 "events": [
1189 {
1190 "content": {
1191 "membership": "leave"
1192 },
1193 "origin_server_ts": 158957809000000_u64,
1194 "sender": "@example:localhost",
1195 "state_key": "@example:localhost",
1196 "type": "m.room.member",
1197 "unsigned": {
1198 "replaces_state": "$blahblah",
1199 "prev_content": {
1200 "avatar_url": null,
1201 "displayname": "me",
1202 "membership": "invite"
1203 },
1204 "prev_sender": "@2example:localhost",
1205 "age": 1757
1206 },
1207 "event_id": "$lQQ116Y-XqcjpSUGpuz36rNntUvOSpTjuaIvmtQ2AwA"
1208 }
1209 ],
1210 "prev_batch": "tokenTOKEN",
1211 "limited": false
1212 },
1213 "state": {
1214 "events": []
1215 },
1216 "account_data": {
1217 "events": []
1218 }
1219 }
1220 }
1221 },
1222 "groups": {
1223 "join": {},
1224 "invite": {},
1225 "leave": {}
1226 },
1227 "device_one_time_keys_count": {
1228 "signed_curve25519": 50
1229 },
1230 "next_batch": "s1380317562_757269739_1655566_503953763_334052043_1209862_55290918_65705002_101146"
1231 })
1232});
1233
1234/// In the [`MIXED_SYNC`], the room id of the joined room.
1235pub static MIXED_JOINED_ROOM_ID: Lazy<&RoomId> =
1236 Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgC:localhost"));
1237/// In the [`MIXED_SYNC`], the room id of the left room.
1238pub static MIXED_LEFT_ROOM_ID: Lazy<&RoomId> =
1239 Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgD:localhost"));
1240/// In the [`MIXED_SYNC`], the room id of the invited room.
1241pub static MIXED_INVITED_ROOM_ID: Lazy<&RoomId> =
1242 Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgE:localhost"));
1243/// In the [`MIXED_SYNC`], the room id of the knocked room.
1244pub static MIXED_KNOCKED_ROOM_ID: Lazy<&RoomId> =
1245 Lazy::new(|| room_id!("!SVkFJHzfwvuaIEawgF:localhost"));
1246
1247/// A sync that contains updates to joined/invited/knocked/left rooms.
1248pub static MIXED_SYNC: Lazy<JsonValue> = Lazy::new(|| {
1249 json!({
1250 "account_data": {
1251 "events": []
1252 },
1253 "to_device": {
1254 "events": []
1255 },
1256 "device_lists": {
1257 "changed": [],
1258 "left": []
1259 },
1260 "presence": {
1261 "events": []
1262 },
1263 "rooms": {
1264 "join": {
1265 *MIXED_JOINED_ROOM_ID: {
1266 "summary": {},
1267 "account_data": {
1268 "events": [
1269 {
1270 "content": {
1271 "event_id": "$someplace:example.org"
1272 },
1273 "room_id": "!roomid:room.com",
1274 "type": "m.fully_read"
1275 }
1276 ]
1277 },
1278 "ephemeral": {
1279 "events": [
1280 {
1281 "content": {
1282 "$151680659217152dPKjd:localhost": {
1283 "m.read": {
1284 "@example:localhost": {
1285 "ts": 151680989
1286 }
1287 }
1288 }
1289 },
1290 "room_id": *MIXED_JOINED_ROOM_ID,
1291 "type": "m.receipt"
1292 },
1293 ]
1294 },
1295 "state": {
1296 "events": [
1297 {
1298 "content": {
1299 "alias": "#tutorial:localhost"
1300 },
1301 "event_id": "$15139375513VdeRF:localhost",
1302 "origin_server_ts": 151393755000000_u64,
1303 "sender": "@example:localhost",
1304 "state_key": "",
1305 "type": "m.room.canonical_alias",
1306 "unsigned": {
1307 "age": 703422
1308 }
1309 },
1310 ]
1311 },
1312 "timeline": {
1313 "events": [
1314 {
1315 "content": {
1316 "body": "baba",
1317 "format": "org.matrix.custom.html",
1318 "formatted_body": "<strong>baba</strong>",
1319 "msgtype": "m.text"
1320 },
1321 "event_id": "$152037280074GZeOm:localhost",
1322 "origin_server_ts": 152037280000000_u64,
1323 "sender": "@example:localhost",
1324 "type": "m.room.message",
1325 "unsigned": {
1326 "age": 598971425
1327 }
1328 }
1329 ],
1330 "limited": true,
1331 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
1332 },
1333 "unread_notifications": {
1334 "highlight_count": 0,
1335 "notification_count": 11
1336 }
1337 }
1338 },
1339 "invite": {
1340 *MIXED_INVITED_ROOM_ID: {
1341 "invite_state": {
1342 "events": [
1343 {
1344 "sender": "@alice:example.com",
1345 "type": "m.room.name",
1346 "state_key": "",
1347 "content": {
1348 "name": "My Room Name"
1349 }
1350 },
1351 {
1352 "sender": "@alice:example.com",
1353 "type": "m.room.member",
1354 "state_key": "@bob:example.com",
1355 "content": {
1356 "membership": "invite"
1357 }
1358 }
1359 ]
1360 }
1361 }
1362 },
1363 "knock": {
1364 *MIXED_KNOCKED_ROOM_ID: {
1365 "knock_state": {
1366 "events": [
1367 {
1368 "sender": "@alice:example.com",
1369 "type": "m.room.name",
1370 "state_key": "",
1371 "content": {
1372 "name": "My Room Name"
1373 }
1374 },
1375 {
1376 "sender": "@bob:example.com",
1377 "type": "m.room.member",
1378 "state_key": "@bob:example.com",
1379 "content": {
1380 "membership": "knock"
1381 }
1382 }
1383 ]
1384 }
1385 }
1386 },
1387 "leave": {
1388 *MIXED_LEFT_ROOM_ID: {
1389 "timeline": {
1390 "events": [
1391 {
1392 "content": {
1393 "membership": "leave"
1394 },
1395 "origin_server_ts": 158957809000000_u64,
1396 "sender": "@example:localhost",
1397 "state_key": "@example:localhost",
1398 "type": "m.room.member",
1399 "unsigned": {
1400 "replaces_state": "$blahblah",
1401 "prev_content": {
1402 "avatar_url": null,
1403 "displayname": "me",
1404 "membership": "invite"
1405 },
1406 "prev_sender": "@2example:localhost",
1407 "age": 1757
1408 },
1409 "event_id": "$lQQ116Y-XqcjpSUGpuz36rNntUvOSpTjuaIvmtQ2AwA"
1410 }
1411 ],
1412 "prev_batch": "toktok",
1413 "limited": false
1414 },
1415 "state": {
1416 "events": []
1417 },
1418 "account_data": {
1419 "events": []
1420 }
1421 }
1422 }
1423 },
1424 "groups": {
1425 "join": {},
1426 "invite": {},
1427 "leave": {}
1428 },
1429 "device_one_time_keys_count": {
1430 "signed_curve25519": 50
1431 },
1432 "next_batch": "s1380317562_757269739_1655566_503953763_334052043_1209862_55290918_65705002_101146"
1433 })
1434});
1435
1436pub static VOIP_SYNC: Lazy<JsonValue> = Lazy::new(|| {
1437 json!({
1438 "device_one_time_keys_count": {},
1439 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
1440 "device_lists": {
1441 "changed": [
1442 "@example:example.org"
1443 ],
1444 "left": []
1445 },
1446 "rooms": {
1447 "invite": {},
1448 "join": {
1449 *DEFAULT_TEST_ROOM_ID: {
1450 "summary": {},
1451 "account_data": {
1452 "events": []
1453 },
1454 "ephemeral": {
1455 "events": [ ]
1456 },
1457 "state": {
1458 "events": []
1459 },
1460 "timeline": {
1461 "events": [
1462 {
1463 "content": {
1464 "call_id": "12345",
1465 "lifetime": 60000,
1466 "offer": {
1467 "sdp": "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]",
1468 "type": "offer"
1469 },
1470 "version": 0
1471 },
1472 "event_id": "$143273582443PhrSn:example.org",
1473 "origin_server_ts": 143273582000000_u64,
1474 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
1475 "sender": "@example:example.org",
1476 "type": "m.call.invite",
1477 "unsigned": {
1478 "age": 1234
1479 }
1480 },
1481 {
1482 "content": {
1483 "answer": {
1484 "sdp": "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]",
1485 "type": "answer"
1486 },
1487 "call_id": "12345",
1488 "lifetime": 60000,
1489 "version": 0
1490 },
1491 "event_id": "$143273582443PhrSn:example.org",
1492 "origin_server_ts": 143273582000000_u64,
1493 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
1494 "sender": "@example:example.org",
1495 "type": "m.call.answer",
1496 "unsigned": {
1497 "age": 1234
1498 }
1499 },
1500 {
1501 "content": {
1502 "call_id": "12345",
1503 "candidates": [
1504 {
1505 "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 type host generation 0",
1506 "sdpMLineIndex": 0,
1507 "sdpMid": "audio"
1508 }
1509 ],
1510 "version": 0
1511 },
1512 "event_id": "$143273582443PhrSn:example.org",
1513 "origin_server_ts": 143273582000000_u64,
1514 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
1515 "sender": "@example:example.org",
1516 "type": "m.call.candidates",
1517 "unsigned": {
1518 "age": 1234
1519 }
1520 },
1521 {
1522 "content": {
1523 "call_id": "12345",
1524 "version": 0
1525 },
1526 "event_id": "$143273582443PhrSn:example.org",
1527 "origin_server_ts": 143273582000000_u64,
1528 "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
1529 "sender": "@example:example.org",
1530 "type": "m.call.hangup",
1531 "unsigned": {
1532 "age": 1234
1533 }
1534 }
1535 ],
1536 "limited": true,
1537 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
1538 },
1539 "unread_notifications": {
1540 "highlight_count": 0,
1541 "notification_count": 11
1542 }
1543 }
1544 },
1545 "leave": {}
1546 },
1547 "to_device": {
1548 "events": []
1549 },
1550 "presence": {
1551 "events": []
1552 }
1553 })
1554});
1555
1556pub static SYNC_ADMIN_AND_MOD: Lazy<JsonValue> = Lazy::new(|| {
1557 json!({
1558 "device_one_time_keys_count": {},
1559 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
1560 "device_lists": {
1561 "changed": [
1562 "@admin:example.org"
1563 ],
1564 "left": []
1565 },
1566 "rooms": {
1567 "invite": {},
1568 "join": {
1569 *DEFAULT_TEST_ROOM_ID: {
1570 "summary": {
1571 "m.heroes": [
1572 "@example2:localhost"
1573 ],
1574 "m.joined_member_count": 2,
1575 "m.invited_member_count": 0
1576 },
1577 "account_data": {
1578 "events": []
1579 },
1580 "ephemeral": {
1581 "events": []
1582 },
1583 "state": {
1584 "events": [
1585 {
1586 "content": {
1587 "join_rule": "public"
1588 },
1589 "event_id": "$15139375514WsgmR:localhost",
1590 "origin_server_ts": 151393755000000_u64,
1591 "sender": "@admin:localhost",
1592 "state_key": "",
1593 "type": "m.room.join_rules",
1594 "unsigned": {
1595 "age": 7034220
1596 }
1597 },
1598 {
1599 "content": {
1600 "avatar_url": null,
1601 "displayname": "admin",
1602 "membership": "join"
1603 },
1604 "event_id": "$151800140517rfvjc:localhost",
1605 "membership": "join",
1606 "origin_server_ts": 151800140000000_u64,
1607 "sender": "@admin:localhost",
1608 "state_key": "@admin:localhost",
1609 "type": "m.room.member",
1610 "unsigned": {
1611 "age": 297036,
1612 "replaces_state": "$151800111315tsynI:localhost"
1613 }
1614 },
1615 {
1616 "content": {
1617 "avatar_url": null,
1618 "displayname": "mod",
1619 "membership": "join"
1620 },
1621 "event_id": "$151800140518rfvjc:localhost",
1622 "membership": "join",
1623 "origin_server_ts": 1518001450000000_u64,
1624 "sender": "@mod:localhost",
1625 "state_key": "@mod:localhost",
1626 "type": "m.room.member",
1627 "unsigned": {
1628 "age": 297035,
1629 }
1630 },
1631 {
1632 "content": {
1633 "history_visibility": "shared"
1634 },
1635 "event_id": "$15139375515VaJEY:localhost",
1636 "origin_server_ts": 151393755000000_u64,
1637 "sender": "@admin:localhost",
1638 "state_key": "",
1639 "type": "m.room.history_visibility",
1640 "unsigned": {
1641 "age": 703422
1642 }
1643 },
1644 {
1645 "content": {
1646 "creator": "@example:localhost"
1647 },
1648 "event_id": "$15139375510KUZHi:localhost",
1649 "origin_server_ts": 151393755000000_u64,
1650 "sender": "@admin:localhost",
1651 "state_key": "",
1652 "type": "m.room.create",
1653 "unsigned": {
1654 "age": 703422
1655 }
1656 },
1657 {
1658 "content": {
1659 "topic": "room topic"
1660 },
1661 "event_id": "$151957878228ssqrJ:localhost",
1662 "origin_server_ts": 151957878000000_u64,
1663 "sender": "@admin:localhost",
1664 "state_key": "",
1665 "type": "m.room.topic",
1666 "unsigned": {
1667 "age": 1392989709,
1668 "prev_content": {
1669 "topic": "test"
1670 },
1671 "prev_sender": "@example:localhost",
1672 "replaces_state": "$151957069225EVYKm:localhost"
1673 }
1674 },
1675 {
1676 "content": {
1677 "ban": 50,
1678 "events": {
1679 "m.room.avatar": 50,
1680 "m.room.canonical_alias": 50,
1681 "m.room.history_visibility": 100,
1682 "m.room.name": 50,
1683 "m.room.power_levels": 100
1684 },
1685 "events_default": 0,
1686 "invite": 0,
1687 "kick": 50,
1688 "redact": 50,
1689 "state_default": 50,
1690 "users": {
1691 "@admin:localhost": 100,
1692 "@mod:localhost": 50
1693 },
1694 "users_default": 0
1695 },
1696 "event_id": "$15139375512JaHAW:localhost",
1697 "origin_server_ts": 151393755000000_u64,
1698 "sender": "@admin:localhost",
1699 "state_key": "",
1700 "type": "m.room.power_levels",
1701 "unsigned": {
1702 "age": 703422
1703 }
1704 }
1705 ]
1706 },
1707 "timeline": {
1708 "events": [
1709 {
1710 "content": {
1711 "body": "baba",
1712 "format": "org.matrix.custom.html",
1713 "formatted_body": "<strong>baba</strong>",
1714 "msgtype": "m.text"
1715 },
1716 "event_id": "$152037280074GZeOm:localhost",
1717 "origin_server_ts": 152037280000000_u64,
1718 "sender": "@admin:localhost",
1719 "type": "m.room.message",
1720 "unsigned": {
1721 "age": 598971425
1722 }
1723 }
1724 ],
1725 "limited": true,
1726 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
1727 },
1728 "unread_notifications": {
1729 "highlight_count": 0,
1730 "notification_count": 11
1731 }
1732 }
1733 },
1734 "leave": {}
1735 },
1736 "to_device": {
1737 "events": []
1738 },
1739 "presence": {
1740 "events": []
1741 }
1742 })
1743});
1744
1745pub static CUSTOM_ROOM_POWER_LEVELS: Lazy<JsonValue> = Lazy::new(|| {
1746 json!({
1747 "device_one_time_keys_count": {},
1748 "next_batch": "s526_47314_0_7_1_1_1_11444_1",
1749 "device_lists": {
1750 "changed": [
1751 "@admin:example.org"
1752 ],
1753 "left": []
1754 },
1755 "rooms": {
1756 "invite": {},
1757 "join": {
1758 *DEFAULT_TEST_ROOM_ID: {
1759 "summary": {
1760 "m.heroes": [
1761 "@example2:localhost"
1762 ],
1763 "m.joined_member_count": 1,
1764 "m.invited_member_count": 0
1765 },
1766 "account_data": {
1767 "events": []
1768 },
1769 "ephemeral": {
1770 "events": []
1771 },
1772 "state": {
1773 "events": [
1774 {
1775 "content": {
1776 "join_rule": "public"
1777 },
1778 "event_id": "$15139375514WsgmR:localhost",
1779 "origin_server_ts": 151393755000000_u64,
1780 "sender": "@admin:localhost",
1781 "state_key": "",
1782 "type": "m.room.join_rules",
1783 "unsigned": {
1784 "age": 7034220
1785 }
1786 },
1787 {
1788 "content": {
1789 "avatar_url": null,
1790 "displayname": "admin",
1791 "membership": "join"
1792 },
1793 "event_id": "$151800140517rfvjc:localhost",
1794 "membership": "join",
1795 "origin_server_ts": 151800140000000_u64,
1796 "sender": "@admin:localhost",
1797 "state_key": "@admin:localhost",
1798 "type": "m.room.member",
1799 "unsigned": {
1800 "age": 297036,
1801 "replaces_state": "$151800111315tsynI:localhost"
1802 }
1803 },
1804 {
1805 "content": {
1806 "creator": "@example:localhost"
1807 },
1808 "event_id": "$15139375510KUZHi:localhost",
1809 "origin_server_ts": 151393755000000_u64,
1810 "sender": "@admin:localhost",
1811 "state_key": "",
1812 "type": "m.room.create",
1813 "unsigned": {
1814 "age": 703422
1815 }
1816 },
1817 {
1818 "content": {
1819 "ban": 100,
1820 "events": {
1821 "m.room.avatar": 100,
1822 "m.room.canonical_alias": 50,
1823 "m.room.history_visibility": 100,
1824 "m.room.name": 50,
1825 "m.room.power_levels": 100
1826 },
1827 "events_default": 0,
1828 "invite": 0,
1829 "kick": 50,
1830 "redact": 50,
1831 "state_default": 50,
1832 "users": {
1833 "@admin:localhost": 100
1834 },
1835 "users_default": 0
1836 },
1837 "event_id": "$15139375512JaHAW:localhost",
1838 "origin_server_ts": 151393755000000_u64,
1839 "sender": "@admin:localhost",
1840 "state_key": "",
1841 "type": "m.room.power_levels",
1842 "unsigned": {
1843 "age": 703422
1844 }
1845 }
1846 ]
1847 },
1848 "timeline": {
1849 "events": [
1850 {
1851 "content": {
1852 "body": "baba",
1853 "format": "org.matrix.custom.html",
1854 "formatted_body": "<strong>baba</strong>",
1855 "msgtype": "m.text"
1856 },
1857 "event_id": "$152037280074GZeOm:localhost",
1858 "origin_server_ts": 152037280000000_u64,
1859 "sender": "@admin:localhost",
1860 "type": "m.room.message",
1861 "unsigned": {
1862 "age": 598971425
1863 }
1864 }
1865 ],
1866 "limited": true,
1867 "prev_batch": "t392-516_47314_0_7_1_1_1_11444_1"
1868 },
1869 "unread_notifications": {
1870 "highlight_count": 0,
1871 "notification_count": 11
1872 }
1873 }
1874 },
1875 "leave": {}
1876 },
1877 "to_device": {
1878 "events": []
1879 },
1880 "presence": {
1881 "events": []
1882 }
1883 })
1884});