Commit 63ae0a979b

63ae0a979b79200d9643d1a4a14b24397e4910ec

parent: 1d27f59d36

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2021-01-03 15:55 UTC

room: Restore the room topic when we restore the room.

Layout: unified · split

Cargo.lock +9 −19
@@ -747,16 +747,6 @@ dependencies = [
747747 "num_cpus",
748748]
749749
750[[package]]
751name = "dashmap"
752version = "4.0.1"
753source = "registry+https://github.com/rust-lang/crates.io-index"
754checksum = "4b937cd1fbd1f194ac842196bd2529f21618088ee6d8bff6a46ece611451c96b"
755dependencies = [
756 "cfg-if 1.0.0",
757 "num_cpus",
758]
759
760750[[package]]
761751name = "digest"
762752version = "0.8.1"
@@ -1520,10 +1510,10 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
15201510[[package]]
15211511name = "matrix-sdk"
15221512version = "0.1.0"
1523source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#0edef38eb70e3aa66fa6d6f52ae00b67d0228d46"
1513source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#74998c8dd80330def131739ce595a2af5bc512e6"
15241514dependencies = [
15251515 "async-trait",
1526 "dashmap 3.11.10",
1516 "dashmap",
15271517 "futures",
15281518 "futures-timer",
15291519 "http",
@@ -1544,10 +1534,10 @@ dependencies = [
15441534[[package]]
15451535name = "matrix-sdk-base"
15461536version = "0.1.0"
1547source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#0edef38eb70e3aa66fa6d6f52ae00b67d0228d46"
1537source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#74998c8dd80330def131739ce595a2af5bc512e6"
15481538dependencies = [
15491539 "async-trait",
1550 "dashmap 4.0.1",
1540 "dashmap",
15511541 "futures",
15521542 "matrix-sdk-common",
15531543 "matrix-sdk-common-macros",
@@ -1564,7 +1554,7 @@ dependencies = [
15641554[[package]]
15651555name = "matrix-sdk-common"
15661556version = "0.1.0"
1567source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#0edef38eb70e3aa66fa6d6f52ae00b67d0228d46"
1557source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#74998c8dd80330def131739ce595a2af5bc512e6"
15681558dependencies = [
15691559 "assign",
15701560 "futures-locks",
@@ -1578,7 +1568,7 @@ dependencies = [
15781568[[package]]
15791569name = "matrix-sdk-common-macros"
15801570version = "0.1.0"
1581source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#0edef38eb70e3aa66fa6d6f52ae00b67d0228d46"
1571source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#74998c8dd80330def131739ce595a2af5bc512e6"
15821572dependencies = [
15831573 "quote",
15841574 "syn",
@@ -1587,7 +1577,7 @@ dependencies = [
15871577[[package]]
15881578name = "matrix-sdk-crypto"
15891579version = "0.1.0"
1590source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#0edef38eb70e3aa66fa6d6f52ae00b67d0228d46"
1580source = "git+https://github.com/matrix-org/matrix-rust-sdk/?branch=new-state-store#74998c8dd80330def131739ce595a2af5bc512e6"
15911581dependencies = [
15921582 "aes-ctr",
15931583 "aes-gcm",
@@ -1595,7 +1585,7 @@ dependencies = [
15951585 "atomic",
15961586 "base64",
15971587 "byteorder",
1598 "dashmap 3.11.10",
1588 "dashmap",
15991589 "getrandom 0.2.0",
16001590 "hmac",
16011591 "matrix-sdk-common",
@@ -3586,7 +3576,7 @@ dependencies = [
35863576 "async-trait",
35873577 "chrono",
35883578 "clap",
3589 "dashmap 3.11.10",
3579 "dashmap",
35903580 "futures",
35913581 "indoc",
35923582 "matrix-sdk",
src/room/mod.rs +4 −3
@@ -327,6 +327,7 @@ impl RoomHandle {
327327 prev_batch.map(PrevBatch::Forward);
328328
329329 room_buffer.update_buffer_name();
330 room_buffer.set_topic();
330331
331332 room_buffer
332333 }
@@ -872,9 +873,9 @@ impl MatrixRoom {
872873 }
873874 }
874875
875 fn set_topic(&self, topic: &str) {
876 fn set_topic(&self) {
876877 if let Ok(buffer) = self.buffer_handle().upgrade() {
877 buffer.set_title(topic);
878 buffer.set_title(&self.room().topic().unwrap_or_default());
878879 }
879880 }
880881
@@ -1009,7 +1010,7 @@ impl MatrixRoom {
10091010 self.handle_membership_event(e, state_event).await
10101011 }
10111012 AnySyncStateEvent::RoomName(_) => self.update_buffer_name(),
1012 AnySyncStateEvent::RoomTopic(t) => self.set_topic(&t.content.topic),
1013 AnySyncStateEvent::RoomTopic(_) => self.set_topic(),
10131014 _ => (),
10141015 }
10151016 }