Merge pull request #29 from Vesuri/master

[commhistory-daemon] Use a call specific NGF event id for missed call no...
[commhistory-daemon] Encode notification data to avoid binary safety issues

It's unspecified whether the notification system supports storing binary
hint values, but at least with the current implementation it may be
unsafe due to sqlite's text encoding behavior.

The x-commhistoryd-data hint on notifications is now base64 encoded.
[commhistory-daemon] Temporarily disable contact authorization notifications

The contact authorization code needs to be modernized, ported to
nemo-notifications, and proper UI handling implemented. Disable it
entirely until these can be done.
Merge pull request #31 from special/disable-authorization

[commhistory-daemon] Temporarily disable contact authorization notifications
Merge pull request #30 from special/base64-data

[commhistory-daemon] Encode notification data to avoid binary safety issues
[commhistory-daemon] Don't attempt to set ring account presence

Mission control misbehaves when ring's presence is set to offline,
dropping all channels and future incoming channels.

I'm looking into a telepathy-side fix to prevent any presence changes to
ring, but commhistory-daemon shouldn't attempt to set it in response to
global presence changes anyway.
Merge pull request #32 from special/ring-presence

[commhistory-daemon] Don't attempt to set ring account presence
[commhistory-daemon] Remove error state for messages sent to offline contacts

For most supported services, offline messaging is possible and the
message will be sent when the remote user connects. It's inappropriate
to mark those messages as failed.

For services that don't do offline messaging, they should return an
error, which will separately set the status to failed.

A banner is displayed the first time you send a message to an offline
contact, reminding you that they are offline. This is not very clear and
should be improved as well.
[commhistory-daemon] Fix ut_messagereviver

Broken since 79e0ea7 (Try to redeliver message if it was not saved).
Merge pull request #34 from martyone/master

[commhistory-daemon] Fix ut_messagereviver
[service] Add -o to invoker exec cmd
Merge pull request #35 from nemomobile/oom

[service] Add -o to invoker exec cmd
[commhistory-daemon] Fix EventModel::eventsCommitted() handling

Qt::QueuedConnection is needed.

(Most probably) this is broken since libcommhistory commits
579ed607531d348747535b803c59082c97503895 (Fix id of returned event from
DatabaseIO::addEvent) and 33dbd0785e5555197448856c611766db5bb8962f (Emit
eventsCommitted signals after modifying an EventModel). Before these
commits EventModel::eventsCommitted() was only emitted *after*
EventModel::addEvents() and similar calls returned. After these commits
the EventModel::eventsCommitted() signal is possibly emitted before
EventModel::addEvents() and similar calls return.

Without QueuedConnection it breaks in
TextChannelListener::handleMessages() around lines 875 and 893 where
addEvents() and modifyEventsInGroup() are called.

The former one explained:

    if (!addEvents.isEmpty()) {
        if (eventModel().addEvents(addEvents)) {
            processedMessages << addMessages;
            foreach (CommHistory::Event e, addEvents)
                m_EventTokens.insertMulti(e.id(), e.messageToken());
        } else {
            qWarning() << "Adding events failed";
        }
    }

Here m_EventTokens is modified only after addEvents() returns -> if the
eventsCommitted() signal is emitted already during the addEvent() call,
it then fails to find the event id in m_EventTokens inside
slotEventsCommitted() at line 1724.
ut_textchannellistener: Fix EventModel::eventsCommitted() handling

(Most probably) this is broken since libcommhistory commits
579ed607531d348747535b803c59082c97503895 (Fix id of returned event from
DatabaseIO::addEvent) and 33dbd0785e5555197448856c611766db5bb8962f (Emit
eventsCommitted signals after modifying an EventModel). Before these
commits EventModel::eventsCommitted() was only emitted *after*
EventModel::addEvents() and similar calls returned. After these commits
the EventModel::eventsCommitted() signal is possibly emitted before
EventModel::addEvents() and similar calls return.
ut_textchannellistener: Wait to let expunging run off the loop

QCoreApplication::processEvents() is not enough here.
[commhistory-daemon] Don't show notifications while inbox is observed
Merge pull request #37 from special/no-notifications-on-inboxobserved

[commhistory-daemon] Don't show notifications while inbox is observed
tests: Cleanup created events upon exit
Merge pull request #36 from martyone/master

Fix one bug + fix tests.
Merge pull request #33 from special/account-error-banner

[commhistory-daemon] Remove error state for messages sent to offline contacts