[Bug 48210] Could TpBaseChannel be more flexible?

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 30 20:06:46 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=48210

--- Comment #6 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-05-30 11:06:46 PDT ---
(In reply to comment #5)
>     * the text MUC has been closed; if we call destroyed() here, the
>       channel manager will dispose of the MUC and its tubes. if we call
>       reopened it'll "close" but then reappear... we don't want that
>       either. we want to emit_closed(), emit_channel_closed() and
>       unregister()

OK, I see why the existing API isn't enough for you. 

I'd prefer you to add a new disappear() with the semantics from Comment #4.
Pseudocode:

void disappear (self)
{
  channel-destroyed = FALSE;
  channel-respawning = FALSE;
  emit closed;
  unregister ();
}

This means that any channel manager whose channels will call disappear() will
have to expand from 2- to 3-case processing of the closed signal, as in Comment
#4:

void on_closed (self, channel)
{
  emit ChannelsClosed([channel]);

  if (channel.is_destroyed())
      /* destroyed() must have been called */
      priv.channels.remove(channel);
  else if (channel.is_respawning())
      /* reopened() must have been called */
      emit NewChannels([channel]);
  else
      /* disappear() must have been called */
      /* do nothing special */
} 

void foreach_channel (self, callback)
{
  for channel in priv.channels
      if channel.is_registered()
          callback (channel);
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list