~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to approver/approver.cpp

  • Committer: Gustavo Pichorim Boiko
  • Date: 2013-08-22 17:51:46 UTC
  • mto: This revision was merged to the branch mainline in revision 731.
  • Revision ID: gustavo.boiko@canonical.com-20130822175146-epb7n2dh3nasa173
Create a new daemon to host the indicators and OSD to get that code out of the
approver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "approver.h"
23
23
#include "approverdbus.h"
24
24
#include "applicationutils.h"
25
 
#include "messagingmenu.h"
26
25
#include "chatmanager.h"
27
26
#include "config.h"
28
27
#include "contactutils.h"
53
52
{
54
53
    ApproverDBus *dbus = new ApproverDBus();
55
54
    connect(dbus,
56
 
            SIGNAL(onMessageSent(const QString&, const QString&)),
57
 
            SLOT(onReplyReceived(const QString&, const QString&)));
58
 
    connect(dbus,
59
55
            SIGNAL(acceptCallRequested()),
60
56
            SLOT(onAcceptCallRequested()));
61
57
    connect(dbus,
62
58
            SIGNAL(rejectCallRequested()),
63
59
            SLOT(onRejectCallRequested()));
64
60
    dbus->connectToBus();
65
 
 
66
 
    connect(MessagingMenu::instance(),
67
 
            SIGNAL(replyReceived(QString,QString)),
68
 
            SLOT(onReplyReceived(QString,QString)));
69
 
    connect(MessagingMenu::instance(), SIGNAL(messageRead(QString,QString)),
70
 
            this, SLOT(onMessageRead(QString,QString)));
71
61
}
72
62
 
73
63
Approver::~Approver()
74
64
{
75
65
}
76
66
 
77
 
void Approver::onMessageRead(const QString &phoneNumber, const QString &encodedMessageId)
78
 
{
79
 
    QString messageId(QByteArray::fromHex(encodedMessageId.toUtf8()));
80
 
    ChatManager::instance()->acknowledgeMessage(phoneNumber, messageId);
81
 
}
82
 
 
83
 
 
84
67
Tp::ChannelClassSpecList Approver::channelFilters() const
85
68
{
86
69
    Tp::ChannelClassSpecList specList;
450
433
        }
451
434
 
452
435
        closeSnapDecision();
453
 
        // add the missed call to the messaging menu
454
 
        MessagingMenu::instance()->addCall(channel->targetContact()->id(), QDateTime::currentDateTime());
455
436
    } else if (state == Tp::CallStateActive) {
456
437
        onApproved(dispatchOperation);
457
438
    }
458
439
}
459
440
 
460
 
void Approver::onReplyReceived(const QString &phoneNumber, const QString &reply)
461
 
{
462
 
    ChatManager::instance()->sendMessage(phoneNumber, reply);
463
 
}
464
 
 
465
441
void Approver::closeSnapDecision()
466
442
{
467
443
    if (mPendingSnapDecision != NULL) {