TelepathyIM / telepathy-morse

Telegram connection manager for the Telepathy framework
GNU General Public License v2.0
61 stars 10 forks source link

Can't start a conversation #5

Closed TemeV closed 9 years ago

TemeV commented 9 years ago

I can't start a conversation with anyone. When someone sends me a message first then I can chat normally with that contact as long as the connection stays alive. Otherwise my phone just says "problem sending message" and this is written in log:

telepathy-morse[30135]: [D] MorseConnection::createChannel:380 - MorseConnection::createChannel "org.freedesktop.Telepathy.Channel.Type.Text" 1 0 QMap(("org.freedesktop.Telepathy.Channel.ChannelType", QVariant(QString, "or g.freedesktop.Telepathy.Channel.Type.Text") ) ( "org.freedesktop.Telepathy.Channel.TargetHandleType" , QVariant(uint, 1) ) ( "org.freedesktop.Telepathy.Channel.TargetID" , QVariant(QString, "49176xxxxxxxx") ) )

TemeV commented 9 years ago

I debugged this a bit more. With Empathy I get same kind of result as with my Jolla phone, but KDE Telepathy works for some reason. There I also get the same log, so TargetHandle is missing from the request there also, but somehow it still manages to create the channel later. With Empathy I can't even open a chat window.

I added a hack to MorseConnection::createChannel and now it works fine with the phone and Empathy, but I don't think this is the real solution.

    if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")) )

    {
        qDebug() << "No target handle!";
        targetHandle = ensureContact(request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID")).toString());
    }
    if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")) )
    {
        initiatorHandle = selfHandle();
    }
Kaffeine commented 9 years ago

I'm sorry to have no time to answer you, but your solution is completely right. Once I had the same problem in ktp, but it got fixed somehow without my attention. I tested it again when you reported it, but could not reproduce.

The issue is inside TpQt internals and I'm working on it every free second at https://github.com/Kaffeine/telepathy-qt Note, that latest commit (BaseConnection::ensureChannel(): Fixed TargetHandle/TargetID processing) address the issue, but it is not a clear solution and will be replaced by better fix.

Big thank you for your work! I think we should include your code in order to completely solve the problem, because the TpQt fix (probably would) cover only ensureChannel() call.

I hope to fix it today.

On Wed, Apr 8, 2015 at 2:31 AM, TemeV notifications@github.com wrote:

I debugged this a bit more. With Empathy I get same kind of result as with my Jolla phone, but KDE Telepathy works for some reason. There I also get the same log, so TargetHandle is missing from the request there also, but somehow it still manages to create the channel later. With Empathy I can't even open a chat window.

I added a hack to MorseConnection::createChannel and now it works fine with the phone and Empathy, but I don't think this is the real solution.

if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")) )

{
    qDebug() << "No target handle!";
    targetHandle = ensureContact(request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID")).toString());
}
if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")) )
{
    initiatorHandle = selfHandle();
}

— Reply to this email directly or view it on GitHub https://github.com/Kaffeine/telepathy-morse/issues/5#issuecomment-90738103 .

Kaffeine commented 9 years ago

By the way for a meantime, we can try to remove TargetID from allowed channel property (connection.cpp:131), thus forcing clients to use requestHandles() and pass TargetHandle in the request details.

On Wed, Apr 8, 2015 at 7:31 AM, Alexandr Akulich <akulichalexander@gmail.com

wrote:

I'm sorry to have no time to answer you, but your solution is completely right. Once I had the same problem in ktp, but it got fixed somehow without my attention. I tested it again when you reported it, but could not reproduce.

The issue is inside TpQt internals and I'm working on it every free second at https://github.com/Kaffeine/telepathy-qt Note, that latest commit (BaseConnection::ensureChannel(): Fixed TargetHandle/TargetID processing) address the issue, but it is not a clear solution and will be replaced by better fix.

Big thank you for your work! I think we should include your code in order to completely solve the problem, because the TpQt fix (probably would) cover only ensureChannel() call.

I hope to fix it today.

On Wed, Apr 8, 2015 at 2:31 AM, TemeV notifications@github.com wrote:

I debugged this a bit more. With Empathy I get same kind of result as with my Jolla phone, but KDE Telepathy works for some reason. There I also get the same log, so TargetHandle is missing from the request there also, but somehow it still manages to create the channel later. With Empathy I can't even open a chat window.

I added a hack to MorseConnection::createChannel and now it works fine with the phone and Empathy, but I don't think this is the real solution.

if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandle")) )

{
    qDebug() << "No target handle!";
    targetHandle = ensureContact(request.value(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetID")).toString());
}
if( !request.contains(TP_QT_IFACE_CHANNEL + QLatin1String(".InitiatorHandle")) )
{
    initiatorHandle = selfHandle();
}

— Reply to this email directly or view it on GitHub https://github.com/Kaffeine/telepathy-morse/issues/5#issuecomment-90738103 .

Kaffeine commented 9 years ago

Probably fixed in 7400a43e55935ba585fe63bac59304bebf9b3b01. Tested with Empathy.