Merge lp:~boiko/telephony-service/ignore_non_supported_accounts into lp:telephony-service

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 1017
Merged at revision: 1018
Proposed branch: lp:~boiko/telephony-service/ignore_non_supported_accounts
Merge into: lp:telephony-service
Diff against target: 75 lines (+17/-3)
4 files modified
approver/approver.cpp (+5/-0)
handler/handler.cpp (+6/-1)
libtelephonyservice/channelobserver.cpp (+5/-1)
libtelephonyservice/telepathyhelper.h (+1/-1)
To merge this branch: bzr merge lp:~boiko/telephony-service/ignore_non_supported_accounts
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+249122@code.launchpad.net

Commit message

Ignore accounts not explicitly supported for now.

Description of the change

Ignore accounts not explicitly supported for now.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'approver/approver.cpp'
2--- approver/approver.cpp 2015-01-20 16:53:01 +0000
3+++ approver/approver.cpp 2015-02-09 20:34:47 +0000
4@@ -146,6 +146,11 @@
5 void Approver::addDispatchOperation(const Tp::MethodInvocationContextPtr<> &context,
6 const Tp::ChannelDispatchOperationPtr &dispatchOperation)
7 {
8+ if (!TelepathyHelper::instance()->supportedProtocols().contains(dispatchOperation->account()->protocolName())) {
9+ context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported.");
10+ return;
11+ }
12+
13 bool willHandle = false;
14
15 QList<Tp::ChannelPtr> channels = dispatchOperation->channels();
16
17=== modified file 'handler/handler.cpp'
18--- handler/handler.cpp 2014-02-27 21:11:59 +0000
19+++ handler/handler.cpp 2015-02-09 20:34:47 +0000
20@@ -47,12 +47,17 @@
21 const QDateTime &userActionTime,
22 const Tp::AbstractClientHandler::HandlerInfo &handlerInfo)
23 {
24- Q_UNUSED(account)
25 Q_UNUSED(connection)
26 Q_UNUSED(requestsSatisfied)
27 Q_UNUSED(userActionTime)
28 Q_UNUSED(handlerInfo)
29
30+ if (!TelepathyHelper::instance()->supportedProtocols().contains(account->protocolName())) {
31+ context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported.");
32+ return;
33+ }
34+
35+
36 Q_FOREACH(const Tp::ChannelPtr channel, channels) {
37 Tp::TextChannelPtr textChannel = Tp::TextChannelPtr::dynamicCast(channel);
38 if (textChannel) {
39
40=== modified file 'libtelephonyservice/channelobserver.cpp'
41--- libtelephonyservice/channelobserver.cpp 2014-02-27 21:11:59 +0000
42+++ libtelephonyservice/channelobserver.cpp 2015-02-09 20:34:47 +0000
43@@ -50,12 +50,16 @@
44 const QList<Tp::ChannelRequestPtr> &requestsSatisfied,
45 const Tp::AbstractClientObserver::ObserverInfo &observerInfo)
46 {
47- Q_UNUSED(account)
48 Q_UNUSED(connection)
49 Q_UNUSED(dispatchOperation)
50 Q_UNUSED(requestsSatisfied)
51 Q_UNUSED(observerInfo)
52
53+ if (!TelepathyHelper::instance()->supportedProtocols().contains(account->protocolName())) {
54+ context->setFinishedWithError(TP_QT_ERROR_NOT_CAPABLE, "The account for this request is not supported.");
55+ return;
56+ }
57+
58 Q_FOREACH (Tp::ChannelPtr channel, channels) {
59 mContexts[channel.data()] = context;
60 mChannels.append(channel);
61
62=== modified file 'libtelephonyservice/telepathyhelper.h'
63--- libtelephonyservice/telepathyhelper.h 2015-01-27 18:56:43 +0000
64+++ libtelephonyservice/telepathyhelper.h 2015-02-09 20:34:47 +0000
65@@ -115,9 +115,9 @@
66 public Q_SLOTS:
67 Q_INVOKABLE void registerChannelObserver(const QString &observerName = QString::null);
68 Q_INVOKABLE void unregisterChannelObserver();
69+ QStringList supportedProtocols() const;
70
71 protected:
72- QStringList supportedProtocols() const;
73 void setupAccountEntry(AccountEntry *entry);
74
75 private Q_SLOTS:

Subscribers

People subscribed via source and target branches