[Bug 27175] Make TpMessage usable in clients
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Thu Oct 21 12:38:52 CEST 2010
https://bugs.freedesktop.org/show_bug.cgi?id=27175
--- Comment #7 from Guillaume Desmottes <guillaume.desmottes at collabora.co.uk> 2010-10-21 03:38:52 PDT ---
(In reply to comment #6)
> (In reply to comment #5)
> > Most of the tp_message_* API makes sense as a base class except:
> > tp_message_new() : as it takes a TpBaseConnection
>
> Yeah, we should add tp_cm_message_new() or something, and eventually deprecate
> tp_message_new().
>
> > tp_message_take_message() ? not sure.
>
> I don't think clients will ever use it, but it's relatively harmless.
I moved it to TpCMMessage for now.
> > > > > - handle refcounting works differently in the CM and in a client
> > > >
> > > > Yeah, which make me think it could be cleaner to have 2 objects.
> > >
> > > It's a sad time that the TpMessage name is already in use...
> >
> > What should we do?
> >
> > Make TpMessage the base class and have TpCMMessage (or TpSvcMessage?) and
> > TpClientMessage (or TpCliMessage?) ? Then we have to document than the methods
> > above can only be used with CM messages but are named that way for historical
> > reason.
>
> I think this is the way forward. It'd be extremely confusing if there's a
> structure called TpMessage that isn't the right thing for clients to use.
>
> I think I'd call them:
>
> TpMessage
> |
> \--- TpCMMessage (used by TpMessageMixin)
> \--- TpClientMessage (if needed, or just use the base class?)
> \--- TpSignalledMessage
> (or TpReceivedMessage, but it's used for MessageSent too)
> (has a TpContact for the sender if possible)
> \--- TpSavedMessage (the handle-less version, for the logger)
>
> Let's reserve the tp_cli, tp_svc naming for the auto-generated stuff.
I have added TpCMMessage, deprecated the "wrong" TpMessage API and added
TPClientMessage (and empty shell atm, I'll rebase my text-channel branch on top
of this one and will continue to work on it to have a clearer idea of its API).
> > Perhaps the solution is to say that message-sender is the only handle that will
> > ever appear in a Message_Part, and deprecate tp_message_set_handle() in favour
> > of a new tp_cm_message_set_sender()?
>
> I'm very tempted to do this. Any thoughts?
Makes sense; I've done that.
--
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