Bug 28680

Summary: Should cache members of group chats
Product: Telepathy Reporter: Guillaume Desmottes <guillaume.desmottes>
Component: loggerAssignee: Guillaume Desmottes <guillaume.desmottes>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/cassidy/telepathy-logger;a=shortlog;h=refs/heads/members
Whiteboard: review+
i915 platform: i915 features:

Description Guillaume Desmottes 2010-06-23 02:33:23 UTC
Currently we cache the TpContact of the TargetHandle of 1-1 text channel so we don't have to recreate it each time we receive a message.

We could do a similar optimissation by caching members of group channels so tp-glib would recycle existing TpContact instead of creating new ones.
Comment 1 Guillaume Desmottes 2010-06-23 07:49:19 UTC
http://git.collabora.co.uk/?p=user/cassidy/telepathy-logger;a=shortlog;h=refs/heads/members

I did some code cleanup while I was on it.
Comment 2 Simon McVittie 2010-06-23 07:59:16 UTC
r+, but I have an additional complaint about a pre-existing bug:

@@ -224,9 +171,8 @@ pendingproc_get_my_contact (TplActionChain *ctx,
       TP_CHANNEL (tpl_text));
   TpHandle my_handle = tp_connection_get_self_handle (tp_conn);
 
-  tpl_text->priv->selector = TP_CONTACT_MYSELF;
   tp_connection_get_contacts_by_handle (tp_conn, 1, &my_handle,
-      G_N_ELEMENTS (features), features, got_contact_cb, ctx, NULL, NULL);
+      G_N_ELEMENTS (features), features, get_self_contact_cb, ctx, NULL, NULL);

In a chatroom, shouldn't this be the channel-specific self-handle, if any?
Comment 3 Guillaume Desmottes 2010-06-24 01:33:18 UTC
Thanks, I merged the branch.

Actually I'm not sure of what the exact semantic is meant to be.
KA: any help?
Comment 4 Cosimo Alfarano 2010-06-24 08:24:14 UTC
Probably it would make more sense to have a channel-specific self-handle instead.

I didn't know the existence of it, this is the only reason TPL was alsways using the connection handle.

As long as the is_user attribute in XML (or equivalent) is set to TRUE on local user's messages and to FALSE on any other message, there is no risk of confusion.
Comment 5 Guillaume Desmottes 2010-06-28 03:30:44 UTC
Thanks, that was I assumed. I've done that:
http://git.collabora.co.uk/?p=user/cassidy/telepathy-logger;a=shortlog;h=refs/heads/members
Comment 6 Simon McVittie 2010-06-28 03:32:10 UTC
yes please
Comment 7 Guillaume Desmottes 2010-06-28 03:57:41 UTC
Merged.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.