[Telepathy] requestHandles method behaviour

Mateus Bellomo mateusbellomo at gmail.com
Mon Sep 19 22:02:16 UTC 2016


I have just noticed that telepathy-morse actually uses the m_handles as the
'oficial' contact list: it is used to get the contacts in
GetContactListAttributes() and the contacts are added there in the
requestHandles() calling.

[1]
https://github.com/TelepathyQt/telepathy-morse/blob/master/connection.cpp#L651

2016-09-19 18:57 GMT-03:00 Mateus Bellomo <mateusbellomo at gmail.com>:

> > The identifier <-> handle map is not the "contact list". Under
> > "contact list" I mean contacts, which e.g. would be returned by
> > Connection.Interface.ContactList GetContactListAttributes().
>
> So in this case you could hold entries like (1,mateus2) and (2,
> mateus2 at test.sip5060.net) in the map that shouldn't be a problem, right?
> And if so, then you would have another way of getting the 'official'
> contact list (like [1] and [2]), right?
>
> [1] https://github.com/TelepathyQt/telepathy-nonsense/blob/master/
> connection.cc#L499
> [2] https://github.com/TelepathyQt/telepathy-morse/
> blob/master/connection.cpp#L661
>
> 2016-09-19 18:37 GMT-03:00 Alexandr Akulich <akulichalexander at gmail.com>:
>
>> Morse and Nonsense both returns a handle list.
>>
>> In case of Nonsense: type of the list is UniqueHandleMap with
>> operators and the used operator [] will return a new handle for each
>> new identifier.
>>
>> https://github.com/TelepathyQt/telepathy-nonsense/blob/
>> master/uniquehandlemap.cc#L32
>>
>> The identifier <-> handle map is not the "contact list". Under
>> "contact list" I mean contacts, which e.g. would be returned by
>> Connection.Interface.ContactList GetContactListAttributes().
>>
>> On Tue, Sep 20, 2016 at 2:28 AM, Mateus Bellomo <mateusbellomo at gmail.com>
>> wrote:
>> > Thanks for the reply guys and sorry for the duplicated post =)
>> >
>> >> The thing is that ensureHandle() does (or at least should) NOT add the
>> >> identifier to the contact list.
>> >
>> > When you say list do you also refer to the map that I hold contacts
>> > identifiers and handles, or you refer just the actual list of contacts?
>> >
>> >> The RequestHandles method do exactly
>> >> one  thing: returns valid handle for identifier. Error "Invalid
>> >> Handle" should be returned if the given identifier does not identify a
>> >> valid entity of the given type.
>> >
>> > Looking at telepathy-nonsense [1] it returns the mapped handle for a
>> > existing contact identifier and I think it will return an empty List if
>> the
>> > contact didn't exist.
>> > But in telepathy-morse [2] it adds the contact to the map if it didn't
>> exist
>> > and then return the List.
>> >
>> > So in this case I should do like telepathy-nonsense?
>> >
>> >> I'm going to suggest it again: ask Empathy developers.
>> >
>> > Is there a specific list for that? I thought this was the correct list.
>> >
>> > [1]
>> > https://github.com/TelepathyQt/telepathy-nonsense/blob/
>> master/connection.cc#L728
>> > [2]
>> > https://github.com/TelepathyQt/telepathy-morse/blob/master/
>> connection.cpp#L635
>> >
>> > 2016-09-19 17:36 GMT-03:00 George Kiagiadakis <gkiagia at tolabaki.gr>:
>> >>
>> >> On 09/19/2016 08:59 PM, Mateus Bellomo wrote:
>> >> > Hello,
>> >> >
>> >> > I have implemented the requestSubscription() and requestHandles()
>> >> > methods at telepathy-resiprocate [1]. I'm using Empathy as a client
>> and
>> >> > testing it I noticed that when I try to add a contact in the contact
>> >> > list, in the window that opens, the method requestHandle() is being
>> >> > called several times while the user is typing the contact to add. So
>> >> > several 'partial' contacts are being added to my map that holds my
>> >> > contact identifiers [2] [3] like this:
>> >> >
>> >> > mateus
>> >> > mateus2@
>> >> > mateus2 at test.s
>> >> > mateus2 at test.sip5060
>> >> > mateus2 at test.sip5060.net <mailto:mateus2 at test.sip5060.net>
>> >> >
>> >> > I'm wondering if this behaviour should be expected from telepathy or
>> >> > it's just a bug.
>> >>
>> >> It doesn't seem to violate the spec, so I would say it's pretty fine
>> for
>> >> a client to do that. It just needs a way to check if an identifier is a
>> >> valid contact or not and this is the best way to do it. Of course, it
>> >> may generate a lot of d-bus traffic, but I don't think that's causing
>> >> any serious problems.
>> >
>> >
>> >
>> > _______________________________________________
>> > telepathy mailing list
>> > telepathy at lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/telepathy
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/telepathy/attachments/20160919/8eb25804/attachment.html>


More information about the telepathy mailing list