[polari] room: Remove leave() method as well
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] room: Remove leave() method as well
- Date: Thu, 8 Aug 2013 13:07:21 +0000 (UTC)
commit 23240ec8e96d75175da32bf57f0533ea15104b81
Author: Florian Müllner <florian muellner gmail com>
Date: Mon Jul 22 16:27:26 2013 +0200
room: Remove leave() method as well
src/application.js | 14 +++++++++++++-
src/lib/polari-room.c | 10 ----------
src/lib/polari-room.h | 2 --
3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 688561c..af5a03b 100644
--- a/src/application.js
+++ b/src/application.js
@@ -171,7 +171,19 @@ const Application = new Lang.Class({
},
_onLeaveRoom: function() {
- this._window._room.leave();
+ let reason = Tp.ChannelGroupChangeReason.NONE;
+ let message = _("Good Bye"); // TODO - our first setting!
+ let room = this._chatroomManager.getActiveRoom();
+ if (!room)
+ return;
+ room.channel.leave_async(reason, message, Lang.bind(this,
+ function(c, res) {
+ try {
+ c.leave_finish(res);
+ } catch(e) {
+ logError(e, 'Failed to leave channel');
+ }
+ }));
},
_onToggleAction: function(action) {
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index 360c3ac..00031ea 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -61,16 +61,6 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE_WITH_PRIVATE (PolariRoom, polari_room, G_TYPE_OBJECT)
-void
-polari_room_leave (PolariRoom *room)
-{
- g_return_if_fail (POLARI_IS_ROOM (room));
-
- tp_channel_leave_async (room->priv->channel,
- TP_CHANNEL_GROUP_CHANGE_REASON_NONE, "Good bye!",
- NULL, NULL);
-}
-
gboolean
polari_room_should_highlight_message (PolariRoom *room,
TpMessage *message)
diff --git a/src/lib/polari-room.h b/src/lib/polari-room.h
index c2c5be0..053ec73 100644
--- a/src/lib/polari-room.h
+++ b/src/lib/polari-room.h
@@ -48,8 +48,6 @@ struct _PolariRoomClass {
GType polari_room_get_type (void) G_GNUC_CONST;
-void polari_room_leave (PolariRoom *room);
-
gboolean polari_room_should_highlight_message (PolariRoom *room,
TpMessage *message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]