telepathyClient: ignore invalidated channels
There is a race if a channel is invalidated during its preparation: the 'invalidated' signal is already emitted so the Shell will never notice. We fix this by simply checking if the channel is already invalidated when receiving it from telepathy-glib. In the approving case, we reject the full ChannelDispatchOperation as we only support approving one channel at the time. https://bugzilla.gnome.org/show_bug.cgi?id=677457
This commit is contained in:
@ -132,6 +132,9 @@ const Client = new Lang.Class({
|
||||
let channel = channels[i];
|
||||
let [targetHandle, targetHandleType] = channel.get_handle();
|
||||
|
||||
if (Shell.is_channel_invalidated(channel))
|
||||
continue;
|
||||
|
||||
/* Only observe contact text channels */
|
||||
if ((!(channel instanceof Tp.TextChannel)) ||
|
||||
targetHandleType != Tp.HandleType.CONTACT)
|
||||
@ -181,6 +184,9 @@ const Client = new Lang.Class({
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Shell.is_channel_invalidated(channel))
|
||||
continue;
|
||||
|
||||
// 'notify' will be true when coming from an actual HandleChannels
|
||||
// call, and not when from a successful Claim call. The point is
|
||||
// we don't want to notify for a channel we just claimed which
|
||||
@ -231,6 +237,11 @@ const Client = new Lang.Class({
|
||||
let channel = channels[0];
|
||||
let chanType = channel.get_channel_type();
|
||||
|
||||
if (Shell.is_channel_invalidated(channel)) {
|
||||
Shell.decline_dispatch_op(context, 'Channel is invalidated');
|
||||
return;
|
||||
}
|
||||
|
||||
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT)
|
||||
this._approveTextChannel(account, conn, channel, dispatchOp, context);
|
||||
else if (chanType == Tp.IFACE_CHANNEL_TYPE_CALL)
|
||||
|
Reference in New Issue
Block a user