I said something wrong before. In fact, telepathy-morse is also adding a contact to the list inside requestHandles() (through ensureContact() line 523 at [1]). Since I couldn't compile it I cannot test it in empathy to see if it behaves like resiprocate.
[1] https://github.com/TelepathyQt/telepathy-morse/blob/master/connection.cpp 2016-06-04 22:14 GMT-03:00 Mateus Bellomo <mateusbell...@gmail.com>: > At requestHandles(), instead of calling ensureHandle(), I tried to check > if it was a contact with that identifier and only in that case I would add > the contact handle to the return list. > > The problem is that it's not adding the contact anymore when I try to add > it. It seems that to add a contact (requestSubscription()), the function > requestHandles() is also being called even tough there isn't a direct call > for requestHandles() inside requestSubscription(). > > I look at empathy website and there it says this (telepathy) is the list > to discuss about empathy. > > > 2016-06-04 18:48 GMT-03:00 Mateus Bellomo <mateusbell...@gmail.com>: > >> > Do the other connection managers store the handles in persistent storage >> somehow? >> >> telepahty-morse store the handles in QMap (like resiprocate) and >> telepathy-nonsense in a QPointer<QXmppClient> (even tough the ensure method >> access an UniqueHandleMap which I don't know what it is). >> >> But Alexandr was helping me with that (just know I see I was sending the >> e-mails directly to him not to the list) and I think I didn't explain the >> problem clearly: >> >> 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. This is happening >> because requestHandles() also call ensureHandle() which add the contact to >> the list. >> >> and the answer of Alexandr: >> >> > 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. >> >> >> >> >> 2016-06-04 18:35 GMT-03:00 Daniel Pocock <dan...@pocock.pro>: >> >>> >>> >>> On 04/06/16 21:51, Mateus Bellomo wrote: >>> > I was looking to telepathy-morse [1] and telepathy-nonsense [2] and it >>> > both don't add a new contact when requestHandles is called so I was >>> > wondering if there is a particularity in resiprocate so we have to add >>> a >>> > contact when requestHandles is called. >>> > >>> >>> Maybe I did it this way because the initial implementation of >>> telepathy-resiprocate didn't have any persistent storage for the contacts >>> >>> Do the other connection managers store the handles in persistent storage >>> somehow? >>> _______________________________________________ >>> 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