Commit 3b7bca92a0

3b7bca92a02d073c73d307b198531242c716a8e2

parent: 85f0a4bc3c

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-11-21 21:40 UTC

room: Add the server name to the room name.

Layout: unified · split

src/room/mod.rs +4 −1
@@ -181,6 +181,7 @@ impl MessageQueue {
181 181
182impl RoomHandle { 182impl RoomHandle {
183 pub fn new( 183 pub fn new(
184 server_name: &str,
184 connection: &Rc<RefCell<Option<Connection>>>, 185 connection: &Rc<RefCell<Option<Connection>>>,
185 config: Rc<RefCell<Config>>, 186 config: Rc<RefCell<Config>>,
186 room: Room, 187 room: Room,
@@ -206,7 +207,9 @@ impl RoomHandle {
206 room, 207 room,
207 }; 208 };
208 209
209 let buffer_handle = BufferBuilderAsync::new(&room_id.to_string()) 210 let buffer_name = format!("{}.{}", server_name, room_id);
211
212 let buffer_handle = BufferBuilderAsync::new(&buffer_name)
210 .input_callback(room.clone()) 213 .input_callback(room.clone())
211 .close_callback(|_weechat: &Weechat, _buffer: &Buffer| { 214 .close_callback(|_weechat: &Weechat, _buffer: &Buffer| {
212 // TODO remove the roombuffer from the server here. 215 // TODO remove the roombuffer from the server here.
src/server.rs +1
@@ -665,6 +665,7 @@ impl InnerServer {
665 room_id 665 room_id
666 )); 666 ));
667 let buffer = RoomHandle::new( 667 let buffer = RoomHandle::new(
668 &self.server_name,
668 &self.connection, 669 &self.connection,
669 self.config.inner.clone(), 670 self.config.inner.clone(),
670 room, 671 room,