~ci-train-bot/history-service/history-service-ubuntu-zesty-2629

« back to all changes in this revision

Viewing changes to daemon/textchannelobserver.cpp

  • Committer: Bileto Bot
  • Author(s): Gustavo Pichorim Boiko
  • Date: 2017-03-23 01:28:52 UTC
  • mfrom: (230.2.35 staging)
  • Revision ID: ci-train-bot@canonical.com-20170323012852-vzmjcare13zofbna
- Adapt to support VOIP accounts.
- Improve the notifications of participants changing
- Only start saving information events about contacts joining and leaving after the self contact is in the local list of participants.
- Improve Roles management performance by caching the retrieved data.
- Mark entire conversations as read.
- Allow pass multiple fields on sort clause.
- Reduce the dbus traffic when marking messages and threads as read.
- Use a QLockFile to ensure there will be only one instance of the daemon per user. As we now delay the registration on dbus, sometimes we ended up having two instances of the daeon running (because of dbus activation). This change makes sure that won't happen.
- Do not load the participants from threads automatically. If the client really needs it, it can use the newly added API to fetch the participants.
- Make it possible to debug sqlite commands.

Approved by: system-apps-ci-bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    connect(textChannel.data(),
40
40
            SIGNAL(messageSent(Tp::Message,Tp::MessageSendingFlags,QString)),
41
41
            SLOT(onMessageSent(Tp::Message,Tp::MessageSendingFlags,QString)));
42
 
    connect(textChannel.data(),
43
 
            SIGNAL(pendingMessageRemoved(const Tp::ReceivedMessage&)),
44
 
            SLOT(onPendingMessageRemoved(const Tp::ReceivedMessage&)));
45
 
 
46
42
    Q_EMIT channelAvailable(textChannel);
47
43
 
48
44
    // process the messages that are already pending in the channel
57
53
{
58
54
    Tp::TextChannelPtr textChannel(qobject_cast<Tp::TextChannel*>(sender()));
59
55
    mChannels.removeAll(textChannel);
 
56
    Q_EMIT textChannelInvalidated(textChannel);
60
57
}
61
58
 
62
59
void TextChannelObserver::onMessageReceived(const Tp::ReceivedMessage &message)
82
79
 
83
80
    Q_EMIT messageSent(textChannel, message, sentMessageToken);
84
81
}
85
 
 
86
 
void TextChannelObserver::onPendingMessageRemoved(const Tp::ReceivedMessage &message)
87
 
{
88
 
    Tp::TextChannelPtr textChannel(qobject_cast<Tp::TextChannel*>(sender()));
89
 
    if (textChannel.isNull()) {
90
 
        return;
91
 
    }
92
 
 
93
 
    Q_EMIT messageRead(textChannel, message);
94
 
}