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