Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Alexandr Akulich
On Tue, Sep 20, 2016 at 2:57 AM, Mateus Bellomo  wrote:
>> 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,mate...@test.sip5060.net) in the map that shouldn't be a problem, right?

Yes. Just a few extra bytes in memory.

> 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
>
You're right, there should be an "official" list and nonsense do it
right, but in Morse there are some Telegram-specific tricks and the
list is not filtered properly.
In Telegram in order to add someone to your contact list you need to
know their phone number. On the other side, you don't have to add
everyone "interesting" to you contacts, because you can access them
via Dialogs — a list of recent conversation.
Telepathy does not support conception of "Dialogs", so in Morse I have
to include such known contacts into Contact List, because it will be
very inconvenient to use the client otherwise.
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Mateus Bellomo
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 :

> > 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,
> mate...@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 :
>
>> 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 
>> 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 :
>> >>
>> >> 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@test.s
>> >> > mateus2@test.sip5060
>> >> > mate...@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@lists.freedesktop.org
>> > https://lists.freedesktop.org/mailman/listinfo/telepathy
>> >
>>
>
>
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Mateus Bellomo
> 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,
mate...@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 :

> 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 
> 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 :
> >>
> >> 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@test.s
> >> > mateus2@test.sip5060
> >> > mate...@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@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/telepathy
> >
>
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Alexandr Akulich
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  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 :
>>
>> 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@test.s
>> > mateus2@test.sip5060
>> > mate...@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/telepathy
>
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Mateus Bellomo
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 :

> 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@test.s
> > mateus2@test.sip5060
> > mate...@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread George Kiagiadakis
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@test.s
> mateus2@test.sip5060
> mate...@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy


Re: [Telepathy] requestHandles method behaviour

2016-09-19 Thread Alexandr Akulich
Hi Mateus,

The question is sounds similar to [1].

I replied personally to you, instead of to the list, so I will quote myself:

On Sun, Jun 5, 2016 at 1:42 AM, Alexandr Akulich
 wrote:
> Hi Mateus.
>
> I know about this behaviour. Empathy wants to get know if the typed
> contact is valid and exists. Telepathy have no such API, so Empathy
> has to workaround it via trying to get info about the contact by typed
> identifier, which (usually) triggers handle assignment, or results in
> "InvalidHandle" error.
>
> The thing is that ensureHandle() does (or at least should) NOT add the
> identifier to the contact list. 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.

On Sun, Jun 5, 2016 at 2:18 AM, Mateus Bellomo  wrote:
> The problem is while I'm typing the identifier of a contact to add, the
> function requestHandles() is being called several times:
>
> Let's say I wan to add a contact mate...@ws.sip5060.net. While I'm typing,
> the function requestHandles() is being called at least 2 times before I hit
> enter so the contacts actually added would be (possibly):
>
> mateus2@w
> mate...@ws.sip5060.net
>
> In this case I have a wrong list after I hit enter because there could be a
> lot of contacts that don't even are a real contact.
>

On Sun, Jun 5, 2016 at 2:32 AM, Alexandr Akulich
 wrote:
> Empathy shows list of all known contacts. While you typing the
> identifier, empathy asks the CM: "is this contact valid?" CM answers:
> "yes, it's valid" and then Empathy adds the contact to the list. It's
> not the user-controllable "contact list", but something like list of
> contacts, referenced in current session.
>
> I would suggest to ask Empathy devs on this regard.
>
> IIRC KDE Telepathy works differently — it just doesn't check
> identifier while user typing.

I'm going to suggest it again: ask Empathy developers.

[1] https://lists.freedesktop.org/archives/telepathy/2016-June/006919.html

On Mon, Sep 19, 2016 at 10: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@test.s
> mateus2@test.sip5060
> mate...@test.sip5060.net
>
> I'm wondering if this behaviour should be expected from telepathy or it's
> just a bug.
>
> Any help would be greatly appreciated.
>
> Thanks!
>
>
> [1] https://github.com/resiprocate/resiprocate/tree/master/apps/telepathy
> [2]
> https://github.com/resiprocate/resiprocate/blob/master/apps/telepathy/Connection.hxx#L104
> [3]
> https://github.com/resiprocate/resiprocate/blob/master/apps/telepathy/Connection.hxx#L105
>
> ___
> telepathy mailing list
> telepathy@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/telepathy
>
___
telepathy mailing list
telepathy@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/telepathy