Commit 40c9f916e3

40c9f916e39503f5f4a1b5db8b625bd1a6b1bd66

parent: 22dc21a517

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-12-20 13:03 UTC

weechat-matrix: Update for the latest rust-sdk.

Layout: unified · split

Cargo.lock −1
@@ -1531,7 +1531,6 @@ dependencies = [
15311531 "sqlx",
15321532 "thiserror",
15331533 "tracing",
1534 "url",
15351534 "zeroize",
15361535]
15371536
src/connection.rs +2 −2
@@ -38,7 +38,7 @@ use matrix_sdk::{
3838 },
3939 events::{AnyMessageEventContent, AnySyncRoomEvent, AnySyncStateEvent},
4040 identifiers::{DeviceIdBox, RoomId},
41 Client, LoopCtrl, Result as MatrixResult, Room, SyncSettings,
41 Client, LoopCtrl, Result as MatrixResult, JoinedRoom, SyncSettings,
4242};
4343
4444use weechat::{Task, Weechat};
@@ -82,7 +82,7 @@ pub enum ClientMessage {
8282 SyncState(RoomId, AnySyncStateEvent),
8383 SyncEvent(RoomId, AnySyncRoomEvent),
8484 Members(RoomId, MembersResponse),
85 RestoredRoom(Room),
85 RestoredRoom(JoinedRoom),
8686}
8787
8888/// Struc representing an active connection to the homeserver.
src/room/members.rs +4 −4
@@ -10,7 +10,7 @@ use matrix_sdk::{
1010 SyncStateEvent,
1111 },
1212 identifiers::UserId,
13 Room, RoomMember,
13 JoinedRoom, RoomMember,
1414};
1515
1616use weechat::{
@@ -23,7 +23,7 @@ use crate::render::render_membership;
2323
2424#[derive(Clone)]
2525pub struct Members {
26 room: Room,
26 room: JoinedRoom,
2727 display_names: Rc<DashMap<String, Rc<DashSet<UserId>>>>,
2828 nicks: Rc<DashMap<UserId, String>>,
2929 pub(super) buffer: Rc<Option<BufferHandle>>,
@@ -37,7 +37,7 @@ pub struct WeechatRoomMember {
3737}
3838
3939impl Members {
40 pub fn new(room: Room) -> Self {
40 pub fn new(room: JoinedRoom) -> Self {
4141 Self {
4242 room,
4343 nicks: DashMap::new().into(),
@@ -225,7 +225,7 @@ impl Members {
225225 })
226226 }
227227
228 fn room(&self) -> &Room {
228 fn room(&self) -> &JoinedRoom {
229229 &self.room
230230 }
231231
src/room/mod.rs +5 −5
@@ -61,7 +61,7 @@ use matrix_sdk::{
6161 },
6262 identifiers::{EventId, RoomId, UserId},
6363 uuid::Uuid,
64 Room,
64 JoinedRoom,
6565};
6666
6767use weechat::{
@@ -138,7 +138,7 @@ pub struct MatrixRoom {
138138 homeserver: Rc<Url>,
139139 room_id: Rc<RoomId>,
140140 own_user_id: Rc<UserId>,
141 room: Room,
141 room: JoinedRoom,
142142 buffer: Rc<Option<BufferHandle>>,
143143
144144 config: Rc<RefCell<Config>>,
@@ -185,7 +185,7 @@ impl RoomHandle {
185185 server_name: &str,
186186 connection: &Rc<RefCell<Option<Connection>>>,
187187 config: Rc<RefCell<Config>>,
188 room: Room,
188 room: JoinedRoom,
189189 homeserver: &Url,
190190 room_id: RoomId,
191191 own_user_id: &UserId,
@@ -275,7 +275,7 @@ impl RoomHandle {
275275 }
276276
277277 pub async fn restore(
278 _room: Room,
278 _room: JoinedRoom,
279279 _connection: &Rc<RefCell<Option<Connection>>>,
280280 _config: Rc<RefCell<Config>>,
281281 _homeserver: &Url,
@@ -972,7 +972,7 @@ impl MatrixRoom {
972972 }
973973 }
974974
975 pub fn room(&self) -> &Room {
975 pub fn room(&self) -> &JoinedRoom {
976976 &self.room
977977 }
978978
src/server.rs +2 −2
@@ -73,7 +73,7 @@ use matrix_sdk::{
7373 },
7474 events::{AnySyncRoomEvent, AnySyncStateEvent},
7575 identifiers::{DeviceIdBox, RoomId, UserId},
76 Client, ClientConfig, Room,
76 Client, ClientConfig, JoinedRoom,
7777};
7878
7979use weechat::{
@@ -744,7 +744,7 @@ impl InnerServer {
744744 self.config.borrow()
745745 }
746746
747 pub async fn restore_room(&mut self, _room: Room) {
747 pub async fn restore_room(&mut self, _room: JoinedRoom) {
748748 // let homeserver = self
749749 // .settings
750750 // .homeserver