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 = [
1531 "sqlx", 1531 "sqlx",
1532 "thiserror", 1532 "thiserror",
1533 "tracing", 1533 "tracing",
1534 "url",
1535 "zeroize", 1534 "zeroize",
1536] 1535]
1537 1536
src/connection.rs +2 −2
@@ -38,7 +38,7 @@ use matrix_sdk::{
38 }, 38 },
39 events::{AnyMessageEventContent, AnySyncRoomEvent, AnySyncStateEvent}, 39 events::{AnyMessageEventContent, AnySyncRoomEvent, AnySyncStateEvent},
40 identifiers::{DeviceIdBox, RoomId}, 40 identifiers::{DeviceIdBox, RoomId},
41 Client, LoopCtrl, Result as MatrixResult, Room, SyncSettings, 41 Client, LoopCtrl, Result as MatrixResult, JoinedRoom, SyncSettings,
42}; 42};
43 43
44use weechat::{Task, Weechat}; 44use weechat::{Task, Weechat};
@@ -82,7 +82,7 @@ pub enum ClientMessage {
82 SyncState(RoomId, AnySyncStateEvent), 82 SyncState(RoomId, AnySyncStateEvent),
83 SyncEvent(RoomId, AnySyncRoomEvent), 83 SyncEvent(RoomId, AnySyncRoomEvent),
84 Members(RoomId, MembersResponse), 84 Members(RoomId, MembersResponse),
85 RestoredRoom(Room), 85 RestoredRoom(JoinedRoom),
86} 86}
87 87
88/// Struc representing an active connection to the homeserver. 88/// Struc representing an active connection to the homeserver.
src/room/members.rs +4 −4
@@ -10,7 +10,7 @@ use matrix_sdk::{
10 SyncStateEvent, 10 SyncStateEvent,
11 }, 11 },
12 identifiers::UserId, 12 identifiers::UserId,
13 Room, RoomMember, 13 JoinedRoom, RoomMember,
14}; 14};
15 15
16use weechat::{ 16use weechat::{
@@ -23,7 +23,7 @@ use crate::render::render_membership;
23 23
24#[derive(Clone)] 24#[derive(Clone)]
25pub struct Members { 25pub struct Members {
26 room: Room, 26 room: JoinedRoom,
27 display_names: Rc<DashMap<String, Rc<DashSet<UserId>>>>, 27 display_names: Rc<DashMap<String, Rc<DashSet<UserId>>>>,
28 nicks: Rc<DashMap<UserId, String>>, 28 nicks: Rc<DashMap<UserId, String>>,
29 pub(super) buffer: Rc<Option<BufferHandle>>, 29 pub(super) buffer: Rc<Option<BufferHandle>>,
@@ -37,7 +37,7 @@ pub struct WeechatRoomMember {
37} 37}
38 38
39impl Members { 39impl Members {
40 pub fn new(room: Room) -> Self { 40 pub fn new(room: JoinedRoom) -> Self {
41 Self { 41 Self {
42 room, 42 room,
43 nicks: DashMap::new().into(), 43 nicks: DashMap::new().into(),
@@ -225,7 +225,7 @@ impl Members {
225 }) 225 })
226 } 226 }
227 227
228 fn room(&self) -> &Room { 228 fn room(&self) -> &JoinedRoom {
229 &self.room 229 &self.room
230 } 230 }
231 231
src/room/mod.rs +5 −5
@@ -61,7 +61,7 @@ use matrix_sdk::{
61 }, 61 },
62 identifiers::{EventId, RoomId, UserId}, 62 identifiers::{EventId, RoomId, UserId},
63 uuid::Uuid, 63 uuid::Uuid,
64 Room, 64 JoinedRoom,
65}; 65};
66 66
67use weechat::{ 67use weechat::{
@@ -138,7 +138,7 @@ pub struct MatrixRoom {
138 homeserver: Rc<Url>, 138 homeserver: Rc<Url>,
139 room_id: Rc<RoomId>, 139 room_id: Rc<RoomId>,
140 own_user_id: Rc<UserId>, 140 own_user_id: Rc<UserId>,
141 room: Room, 141 room: JoinedRoom,
142 buffer: Rc<Option<BufferHandle>>, 142 buffer: Rc<Option<BufferHandle>>,
143 143
144 config: Rc<RefCell<Config>>, 144 config: Rc<RefCell<Config>>,
@@ -185,7 +185,7 @@ impl RoomHandle {
185 server_name: &str, 185 server_name: &str,
186 connection: &Rc<RefCell<Option<Connection>>>, 186 connection: &Rc<RefCell<Option<Connection>>>,
187 config: Rc<RefCell<Config>>, 187 config: Rc<RefCell<Config>>,
188 room: Room, 188 room: JoinedRoom,
189 homeserver: &Url, 189 homeserver: &Url,
190 room_id: RoomId, 190 room_id: RoomId,
191 own_user_id: &UserId, 191 own_user_id: &UserId,
@@ -275,7 +275,7 @@ impl RoomHandle {
275 } 275 }
276 276
277 pub async fn restore( 277 pub async fn restore(
278 _room: Room, 278 _room: JoinedRoom,
279 _connection: &Rc<RefCell<Option<Connection>>>, 279 _connection: &Rc<RefCell<Option<Connection>>>,
280 _config: Rc<RefCell<Config>>, 280 _config: Rc<RefCell<Config>>,
281 _homeserver: &Url, 281 _homeserver: &Url,
@@ -972,7 +972,7 @@ impl MatrixRoom {
972 } 972 }
973 } 973 }
974 974
975 pub fn room(&self) -> &Room { 975 pub fn room(&self) -> &JoinedRoom {
976 &self.room 976 &self.room
977 } 977 }
978 978
src/server.rs +2 −2
@@ -73,7 +73,7 @@ use matrix_sdk::{
73 }, 73 },
74 events::{AnySyncRoomEvent, AnySyncStateEvent}, 74 events::{AnySyncRoomEvent, AnySyncStateEvent},
75 identifiers::{DeviceIdBox, RoomId, UserId}, 75 identifiers::{DeviceIdBox, RoomId, UserId},
76 Client, ClientConfig, Room, 76 Client, ClientConfig, JoinedRoom,
77}; 77};
78 78
79use weechat::{ 79use weechat::{
@@ -744,7 +744,7 @@ impl InnerServer {
744 self.config.borrow() 744 self.config.borrow()
745 } 745 }
746 746
747 pub async fn restore_room(&mut self, _room: Room) { 747 pub async fn restore_room(&mut self, _room: JoinedRoom) {
748 // let homeserver = self 748 // let homeserver = self
749 // .settings 749 // .settings
750 // .homeserver 750 // .homeserver