TelepathyClient: Simplify the channel filter specifications
https://bugzilla.gnome.org/show_bug.cgi?id=611613
This commit is contained in:
parent
016ad69550
commit
7160e8a137
@ -19,6 +19,22 @@ const SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes
|
|||||||
const SCROLLBACK_RECENT_LENGTH = 20;
|
const SCROLLBACK_RECENT_LENGTH = 20;
|
||||||
const SCROLLBACK_IDLE_LENGTH = 5;
|
const SCROLLBACK_IDLE_LENGTH = 5;
|
||||||
|
|
||||||
|
// A 'Qualified_Property_Value_Map' that represents a single-user
|
||||||
|
// text-based chat.
|
||||||
|
let singleUserTextChannel = {};
|
||||||
|
singleUserTextChannel[Telepathy.CHANNEL_NAME + '.ChannelType'] = Telepathy.CHANNEL_TEXT_NAME;
|
||||||
|
singleUserTextChannel[Telepathy.CHANNEL_NAME + '.TargetHandleType'] = Telepathy.HandleType.CONTACT;
|
||||||
|
|
||||||
|
// Some protocols only support 'multi-user' chats, and single-user
|
||||||
|
// chats are just treated as multi-user chats with only one other
|
||||||
|
// participant. Telepathy uses HandleType.NONE for all chats in these
|
||||||
|
// protocols; there's no good way for us to tell if the channel is
|
||||||
|
// single- or multi-user.
|
||||||
|
let oneOrMoreUserTextChannel = {};
|
||||||
|
oneOrMoreUserTextChannel[Telepathy.CHANNEL_NAME + '.ChannelType'] = Telepathy.CHANNEL_TEXT_NAME;
|
||||||
|
oneOrMoreUserTextChannel[Telepathy.CHANNEL_NAME + '.TargetHandleType'] = Telepathy.HandleType.NONE;
|
||||||
|
|
||||||
|
|
||||||
// This is GNOME Shell's implementation of the Telepathy 'Client'
|
// This is GNOME Shell's implementation of the Telepathy 'Client'
|
||||||
// interface. Specifically, the shell is a Telepathy 'Observer', which
|
// interface. Specifically, the shell is a Telepathy 'Observer', which
|
||||||
// lets us see messages even if they belong to another app (eg,
|
// lets us see messages even if they belong to another app (eg,
|
||||||
@ -83,20 +99,7 @@ Client.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get ObserverChannelFilter() {
|
get ObserverChannelFilter() {
|
||||||
return [
|
return [ singleUserTextChannel, oneOrMoreUserTextChannel ];
|
||||||
// We only care about single-user text-based chats
|
|
||||||
{ 'org.freedesktop.Telepathy.Channel.ChannelType': Telepathy.CHANNEL_TEXT_NAME,
|
|
||||||
'org.freedesktop.Telepathy.Channel.TargetHandleType': Telepathy.HandleType.CONTACT },
|
|
||||||
|
|
||||||
// Some protocols only support "multi-user" chats, and
|
|
||||||
// single-user chats are just treated as multi-user chats
|
|
||||||
// with only one other participant. Telepathy uses
|
|
||||||
// HandleType.NONE for all chats in these protocols;
|
|
||||||
// there's no good way for us to tell if the channel is
|
|
||||||
// single- or multi-user.
|
|
||||||
{ 'org.freedesktop.Telepathy.Channel.ChannelType': Telepathy.CHANNEL_TEXT_NAME,
|
|
||||||
'org.freedesktop.Telepathy.Channel.TargetHandleType': Telepathy.HandleType.NONE }
|
|
||||||
];
|
|
||||||
},
|
},
|
||||||
|
|
||||||
ObserveChannels: function(accountPath, connPath, channels,
|
ObserveChannels: function(accountPath, connPath, channels,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user