[polari] roomManager: Add account parameter to lookupRoomByName()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] roomManager: Add account parameter to lookupRoomByName()
- Date: Mon, 13 Mar 2017 02:49:12 +0000 (UTC)
commit 1ae1d7e845478ddda690b848ad9656450e9f6da6
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Mar 11 01:53:48 2017 +0100
roomManager: Add account parameter to lookupRoomByName()
Room names are only unique within a network, so we need an additional
account parameter to unequivocally identify a room. Being able to
/part rooms from any network may arguably be handy (yet unexpected),
but we really need to identify the correct room in the other case
where we match by room name:
The join dialog's room list presents already joined rooms as checked
but insensitive, so it is currently impossible to pick a room that
is joined on a different network.
https://bugzilla.gnome.org/show_bug.cgi?id=779906
src/ircParser.js | 2 +-
src/roomManager.js | 4 ++--
src/serverRoomManager.js | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/ircParser.js b/src/ircParser.js
index dac12b1..0f39e86 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -220,7 +220,7 @@ const IrcParser = new Lang.Class({
let room = null;;
let name = argv[0];
if (name)
- room = this._roomManager.lookupRoomByName(name);
+ room = this._roomManager.lookupRoomByName(name, this._room.account);
if (room)
argv.shift(); // first arg was a room name
else
diff --git a/src/roomManager.js b/src/roomManager.js
index f00065c..6c80215 100644
--- a/src/roomManager.js
+++ b/src/roomManager.js
@@ -58,9 +58,9 @@ const _RoomManager = new Lang.Class({
return this._rooms.get(id);
},
- lookupRoomByName: function(name) {
+ lookupRoomByName: function(name, account) {
for (let room of this._rooms.values())
- if (room.channel_name == name)
+ if (room.channel_name == name && room.account == account)
return room;
return null;
},
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 9176a0e..923c54b 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -253,7 +253,7 @@ const ServerRoomList = new Lang.Class({
if (name[0] == '#')
name = name.substr(1, name.length);
- let room = roomManager.lookupRoomByName(roomInfo.get_name());
+ let room = roomManager.lookupRoomByName(roomInfo.get_name(), this._account);
let sensitive = room == null;
let checked = !sensitive;
let count = '%d'.format(roomInfo.get_members_count(null));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]