[Telepathy] message received method

Mateus Bellomo mateusbellomo at gmail.com
Sat Jul 23 04:16:17 UTC 2016


George,

I could make it work but for that I have swaped the initiatorHandle and
targetHandle on the onMessageReceived() method. You could see at [1] what I
did. Doing this, the channel created has the same parameters when I do a
createChannel() [2] operation and the message sent and receive are now
appearing at same window [3].

I don't know if this implementation is the most suitable, what do you think?

[1]
https://github.com/resiprocate/resiprocate/compare/master...MateusBellomo:mateus-presence-text#diff-82d1d1ba25e34af050fd6a6c5e5311dfR498
[2]
https://github.com/resiprocate/resiprocate/compare/master...MateusBellomo:mateus-presence-text#diff-82d1d1ba25e34af050fd6a6c5e5311dfR650
[3] https://mateusbellomo.wordpress.com/

2016-07-22 20:13 GMT-03:00 Mateus Bellomo <mateusbellomo at gmail.com>:

> Thanks for the great explanation George.
>
> Doy you know if the TargetID and InitiatorID must have the prefix "sip:"
> (e.g. sip:mateusbellomo at sip.antisip.com)?
>
> 2016-07-22 2:35 GMT-03:00 George Kiagiadakis <gkiagia at tolabaki.gr>:
>
>> On 21.07.2016 22:07, Mateus Bellomo wrote:
>>
>>> Hello,
>>>
>>> I've implemented methods to send and receive text message at
>>> telepathy-resiprocate but I think I'm mixing the sender/receiver
>>> handles. I'm using telepathy-morse [1] as a guide and I would like to
>>> know what is the meaning of contactHandle, targetHandle and
>>> initiatorHandle.
>>>
>>> Right now I can send and receive text messages at
>>> telepathy-resiprocate in Empathy and this is what happening: when I
>>> receive a message (sent from Jitsi to telepathy-resiprocate) it shows
>>> in a window that appears to be a conversation with myself
>>> (telepathy-resiprocate Empathy with telepathy-resiprocate Empathy) and
>>> if I send a message through this same window from
>>> telepathy-resiprocate client, it actually sends the message to myself.
>>>
>>> Any help would be greatly appreciated. Thanks.
>>>
>>> [1]
>>> https://github.com/TelepathyQt/telepathy-morse/blob/master/connection.cpp#L928
>>> [1]
>>>
>>>
>> Generally, the InitiatorHandle [1] is the handle of the *contact* that
>> initiated the channel. If you start talking with Bob on your client, then
>> the initiator is you. If Bob begins chatting with you first, then Bob is
>> the initiator. If Bob starts talking with Alice in a chatroom and then
>> Alice invites you, the initiator is Alice.
>>
>> This piece of code that you have linked looks like it is being called
>> when someone else initiates a channel, either 1-to-1 or a room. When it is
>> a 1-to-1 channel (chatMessage == false, ... bad name for a variable I
>> guess), the InitiatorHandle is the peer identifier, which I guess is the
>> remote contact that started the channel. When it is a room channel
>> (chatMessage == true), it uses the message.userId handle as the Initiator,
>> which I don't really know what it represents, but it *should* represent the
>> contact that initiated the chat room (i.e. invited you to join).
>>
>> Now the TargetHandle [2] is the handle of the contact or room that this
>> channel allows you to communicate with. This is always the remote contact
>> in 1-to-1 channels and a room identifier in room channels.
>>
>> I hope this helps. Note that this code may well be wrong or may rely on
>> protocol-specific quirks that are not the same on SIP, so you should try to
>> understand first what Telepathy expects from your connection manager and
>> then try to provide it in the best way possible.
>>
>> [1].
>> https://telepathy.freedesktop.org/spec/Channel.html#Property:InitiatorHandle
>> .
>> [2].
>> https://telepathy.freedesktop.org/spec/Channel.html#Property:TargetHandle
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/telepathy/attachments/20160723/c3b4cf97/attachment.html>


More information about the telepathy mailing list