author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:12:40 +0300 | |
changeset 44 | 36f374c67aa8 |
parent 43 | 35b64624a9e7 |
child 47 | 5b14749788d7 |
child 52 | 12db4185673b |
permissions | -rw-r--r-- |
31 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Listen to conversation server events and parse the |
|
15 |
* events. These parse infomation passed to notifications and indications. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
// SYSTEM INCLUDES |
|
20 |
#include <msvapi.h> |
|
21 |
#include <ccsclientconversation.h> |
|
22 |
#include <ccsrequesthandler.h> |
|
23 |
#include <ccsconversationentry.h> |
|
24 |
#include <xqservicerequest.h> |
|
25 |
#include <QString> |
|
26 |
#include <w32std.h> |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
27 |
#include <apgtask.h> |
31 | 28 |
#include <XQSettingsManager> |
29 |
#include <xqpublishandsubscribeutils.h> |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
30 |
#include <xqsystemtoneservice.h> |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
31 |
#include <xqconversions.h> |
31 | 32 |
|
33 |
//USER INCLUDES |
|
34 |
#include "msgnotifier.h" |
|
35 |
#include "msgnotifier_p.h" |
|
36 |
#include "msgstorehandler.h" |
|
37 |
#include "msginfodefs.h" |
|
38 |
#include "conversationidpsconsts.h" |
|
39 |
#include "debugtraces.h" |
|
40 |
||
41 |
// ---------------------------------------------------------------------------- |
|
42 |
// MsgNotifierPrivate::MsgNotifierPrivate |
|
43 |
// @see MsgNotifierPrivate.h |
|
44 |
// ---------------------------------------------------------------------------- |
|
45 |
MsgNotifierPrivate::MsgNotifierPrivate(MsgNotifier* MsgNotifier) : |
|
46 |
q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL), |
|
47 |
mSettingsManager(NULL),mPSUtils(NULL) |
|
48 |
{ |
|
49 |
QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter") |
|
50 |
||
51 |
TRAP_IGNORE(initL()); |
|
52 |
QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit") |
|
53 |
} |
|
54 |
||
55 |
// ---------------------------------------------------------------------------- |
|
56 |
// MsgNotifierPrivate::~MsgNotifierPrivate |
|
57 |
// @see MsgNotifierPrivate.h |
|
58 |
// ---------------------------------------------------------------------------- |
|
59 |
MsgNotifierPrivate::~MsgNotifierPrivate() |
|
60 |
{ |
|
61 |
QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter") |
|
62 |
if (mCvServer) { |
|
63 |
mCvServer->RemoveConversationListChangeEventL(this); |
|
64 |
delete mCvServer; |
|
65 |
mCvServer = NULL; |
|
66 |
} |
|
67 |
||
68 |
if (iMsgStoreHandler) { |
|
69 |
delete iMsgStoreHandler; |
|
70 |
iMsgStoreHandler = NULL; |
|
71 |
} |
|
72 |
||
73 |
if(mPSUtils) |
|
74 |
{ |
|
75 |
delete mPSUtils; |
|
76 |
} |
|
77 |
||
78 |
if(mSettingsManager) |
|
79 |
{ |
|
80 |
delete mSettingsManager; |
|
81 |
} |
|
82 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
83 |
if(mSts) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
84 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
85 |
delete mSts; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
86 |
mSts = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
87 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
88 |
|
31 | 89 |
QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit") |
90 |
} |
|
91 |
||
92 |
// ---------------------------------------------------------------------------- |
|
93 |
// MsgNotifierPrivate::initL |
|
94 |
// @see MsgNotifierPrivate.h |
|
95 |
// ---------------------------------------------------------------------------- |
|
96 |
void MsgNotifierPrivate::initL() |
|
97 |
{ |
|
98 |
QDEBUG_WRITE("MsgNotifierPrivate::initL : Enter") |
|
99 |
||
100 |
mCvServer = CCSRequestHandler::NewL(); |
|
101 |
mCvServer->RequestConversationListChangeEventL(this); |
|
102 |
iMsgStoreHandler = new MsgStoreHandler(this, mCvServer); |
|
103 |
updateUnreadIndications(true); |
|
104 |
updateOutboxIndications(); |
|
105 |
||
106 |
mSettingsManager = new XQSettingsManager(); |
|
107 |
||
108 |
// define property |
|
109 |
mPSUtils = new XQPublishAndSubscribeUtils(*mSettingsManager); |
|
110 |
XQPublishAndSubscribeSettingsKey convIdKey( |
|
111 |
KMsgCVIdProperty, KMsgCVIdKey); |
|
112 |
bool success = mPSUtils->defineProperty(convIdKey, |
|
113 |
XQSettingsManager::TypeInt); |
|
114 |
||
115 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL " |
|
116 |
"property creation ret value",success) |
|
117 |
||
118 |
// write -1 initially |
|
119 |
success = mSettingsManager->writeItemValue(convIdKey,-1); |
|
120 |
||
121 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL " |
|
122 |
"writing ret value",success) |
|
123 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
124 |
mSts = new XQSystemToneService(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
125 |
|
31 | 126 |
QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit") |
127 |
} |
|
128 |
||
129 |
// ---------------------------------------------------------------------------- |
|
130 |
// MsgNotifierPrivate::AddConversationList |
|
131 |
// @see MsgNotifierPrivate.h |
|
132 |
// ---------------------------------------------------------------------------- |
|
133 |
void MsgNotifierPrivate::AddConversationList( |
|
134 |
const CCsClientConversation& aClientConversation) |
|
135 |
{ |
|
136 |
QDEBUG_WRITE("MsgNotifierPrivate::AddConversationList : Enter") |
|
137 |
||
138 |
processListEntry(aClientConversation); |
|
139 |
updateUnreadIndications(); |
|
140 |
||
141 |
QDEBUG_WRITE("MsgNotifierPrivate::AddConversationList : Exit") |
|
142 |
} |
|
143 |
||
144 |
// ---------------------------------------------------------------------------- |
|
145 |
// MsgNotifierPrivate::DeleteConversationList |
|
146 |
// @see MsgNotifierPrivate.h |
|
147 |
// ---------------------------------------------------------------------------- |
|
148 |
void MsgNotifierPrivate::DeleteConversationList( |
|
149 |
const CCsClientConversation& /*aClientConversation*/) |
|
150 |
{ |
|
151 |
QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Enter") |
|
152 |
updateUnreadIndications(); |
|
153 |
QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Exit") |
|
154 |
} |
|
155 |
||
156 |
// ---------------------------------------------------------------------------- |
|
157 |
// MsgNotifierPrivate::ModifyConversationList |
|
158 |
// @see MsgNotifierPrivate.h |
|
159 |
// ---------------------------------------------------------------------------- |
|
160 |
void MsgNotifierPrivate::ModifyConversationList(const CCsClientConversation& aClientConversation) |
|
161 |
{ |
|
162 |
QDEBUG_WRITE("MsgNotifierPrivate::ModifyConversationList : Enter") |
|
163 |
||
164 |
processListEntry(aClientConversation); |
|
165 |
updateUnreadIndications(); |
|
166 |
||
167 |
QDEBUG_WRITE("MsgNotifierPrivate::ModifyConversationList : Exit") |
|
168 |
} |
|
169 |
||
170 |
// ---------------------------------------------------------------------------- |
|
171 |
// MsgNotifierPrivate::RefreshConversationList |
|
172 |
// @see MsgNotifierPrivate.h |
|
173 |
// ---------------------------------------------------------------------------- |
|
174 |
void MsgNotifierPrivate::RefreshConversationList() |
|
175 |
{ |
|
176 |
||
177 |
} |
|
178 |
||
179 |
// ---------------------------------------------------------------------------- |
|
180 |
// MsgNotifierPrivate::processListEntry |
|
181 |
// @see MsgNotifierPrivate.h |
|
182 |
// ---------------------------------------------------------------------------- |
|
183 |
void MsgNotifierPrivate::processListEntry( |
|
184 |
const CCsClientConversation& aClientConversation) |
|
185 |
{ |
|
186 |
QDEBUG_WRITE("MsgNotifierPrivate::processListEntry : Enter") |
|
187 |
||
188 |
CCsConversationEntry* convEntry = |
|
189 |
aClientConversation.GetConversationEntry(); |
|
190 |
||
191 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry Direction", |
|
192 |
convEntry->ConversationDir()) |
|
193 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry New Entry Attribute", |
|
194 |
convEntry->IsAttributeSet(ECsAttributeNewEntryAdded)) |
|
195 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry Unread Attribute", |
|
196 |
convEntry->IsAttributeSet(ECsAttributeUnread)) |
|
197 |
||
198 |
if((convEntry->ConversationDir() == ECsDirectionIncoming) |
|
199 |
&& convEntry->IsAttributeSet(ECsAttributeNewEntryAdded) |
|
200 |
&& convEntry->IsAttributeSet(ECsAttributeUnread)) |
|
201 |
{ |
|
202 |
QDEBUG_WRITE("processListEntry : Processing data for Notification") |
|
203 |
||
204 |
NotificationData notifData; |
|
205 |
notifData.msvEntryId = convEntry->EntryId(); |
|
206 |
notifData.mConversationId = aClientConversation.GetConversationEntryId(); |
|
207 |
notifData.mMsgType = static_cast<int>(convEntry->GetType()); |
|
208 |
||
209 |
HBufC* displayName = aClientConversation.GetDisplayName(); |
|
210 |
HBufC* number = convEntry->Contact(); |
|
211 |
HBufC* descrp = convEntry->Description(); |
|
212 |
||
213 |
if(displayName) |
|
214 |
{ |
|
215 |
notifData.mDisplayName = |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
216 |
XQConversions::s60DescToQString(*displayName); |
31 | 217 |
} |
218 |
if(number) |
|
219 |
{ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
220 |
notifData.mContactNum = XQConversions::s60DescToQString(*number); |
31 | 221 |
} |
222 |
if(descrp) |
|
223 |
{ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
224 |
notifData.mDescription = XQConversions::s60DescToQString(*descrp); |
31 | 225 |
} |
226 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
227 |
//Play new message alert tone. |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
228 |
mSts->playTone(XQSystemToneService::SmsAlertTone); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
229 |
|
31 | 230 |
// check whether opened cv id and received |
231 |
// cv id are same and show notification |
|
232 |
if( showNotification(notifData.mConversationId )) |
|
233 |
{ |
|
234 |
q_ptr->displayNewMessageNotification(notifData); |
|
235 |
QDEBUG_WRITE("processListEntry : Notification display called") |
|
236 |
} |
|
237 |
||
238 |
} |
|
239 |
||
240 |
QDEBUG_WRITE("MsgNotifierPrivate::processListEntry : Exit") |
|
241 |
} |
|
242 |
||
243 |
// ---------------------------------------------------------------------------- |
|
244 |
// MsgNotifierPrivate::updateUnreadIndications |
|
245 |
// @see MsgNotifierPrivate.h |
|
246 |
// ---------------------------------------------------------------------------- |
|
247 |
void MsgNotifierPrivate::updateUnreadIndications(bool bootup) |
|
248 |
{ |
|
249 |
QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Enter") |
|
250 |
||
251 |
int unreadCount(0); |
|
252 |
if(bootup) |
|
253 |
{ |
|
254 |
TRAP_IGNORE(unreadCount = iMsgStoreHandler->GetUnreadMessageCountL()); |
|
255 |
} |
|
256 |
else |
|
257 |
{ |
|
258 |
TRAP_IGNORE(unreadCount = mCvServer->GetTotalUnreadCountL()); |
|
259 |
} |
|
260 |
||
261 |
QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::" |
|
262 |
"updateIndications unreadCount = ",unreadCount ); |
|
263 |
||
264 |
//activate or deactivate indications based on unread count |
|
265 |
q_ptr->updateUnreadIndications(unreadCount); |
|
266 |
||
267 |
QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Exit") |
|
268 |
} |
|
269 |
||
270 |
// ---------------------------------------------------------------------------- |
|
271 |
// MsgNotifierPrivate::updateOutboxIndications |
|
272 |
// @see MsgNotifierPrivate.h |
|
273 |
// ---------------------------------------------------------------------------- |
|
274 |
void MsgNotifierPrivate::updateOutboxIndications() |
|
275 |
{ |
|
276 |
||
277 |
MsgInfo failedIndicatorData; |
|
278 |
MsgInfo pendingIndicatorData; |
|
279 |
TInt err = KErrNone; |
|
280 |
||
281 |
TRAP(err, iMsgStoreHandler->GetOutboxEntriesL(failedIndicatorData,pendingIndicatorData)); |
|
282 |
||
283 |
q_ptr->updateOutboxIndications(failedIndicatorData); |
|
284 |
q_ptr->updateOutboxIndications(pendingIndicatorData); |
|
285 |
} |
|
286 |
||
287 |
||
288 |
// ---------------------------------------------------------------------------- |
|
289 |
// MsgNotifierPrivate::displayOutboxIndications |
|
290 |
// @see MsgNotifierPrivate.h |
|
291 |
// ---------------------------------------------------------------------------- |
|
292 |
||
293 |
void MsgNotifierPrivate::displayOutboxIndications(MsgInfo data) |
|
294 |
{ |
|
295 |
q_ptr->updateOutboxIndications(data); |
|
296 |
} |
|
297 |
||
298 |
// ---------------------------------------------------------------------------- |
|
299 |
// MsgNotifierPrivate::displayFailedNote |
|
300 |
// @see MsgNotifierPrivate.h |
|
301 |
// ---------------------------------------------------------------------------- |
|
302 |
void MsgNotifierPrivate::displayFailedNote(MsgInfo info) |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
303 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
304 |
QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote start.") |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
305 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
306 |
// check whether opened cv id and received |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
307 |
// cv id are same then dont show failed note |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
308 |
if (!showNotification(info.mConversationId)) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
309 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
310 |
return; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
311 |
} |
31 | 312 |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
313 |
//Even if name string is empty we shall add name into args |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
314 |
QString nameString; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
315 |
|
31 | 316 |
info.mDisplayName.removeDuplicates(); |
317 |
info.mDisplayName.sort(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
318 |
|
31 | 319 |
nameString.append(info.mDisplayName.at(0)); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
320 |
for (int i = 1; i < info.mDisplayName.count(); ++i) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
321 |
{ |
31 | 322 |
nameString.append(", "); |
323 |
nameString.append(info.mDisplayName.at(i)); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
324 |
} |
31 | 325 |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
326 |
// create request arguments |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
327 |
QVariantList args; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
328 |
args << QVariant(nameString); |
31 | 329 |
args << info.mConversationId; |
330 |
args << info.mMessageType; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
331 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
332 |
// TODO: use XQAiwRequest |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
333 |
XQServiceRequest snd("messaging.com.nokia.symbian.MsgErrorNotifier", |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
334 |
"displayErrorNote(QVariantList)", false); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
335 |
|
31 | 336 |
snd << args; |
337 |
snd.send(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
338 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
339 |
QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote end.") |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
340 |
} |
31 | 341 |
|
342 |
// ---------------------------------------------------------------------------- |
|
343 |
// MsgNotifierPrivate::showNotification |
|
344 |
// @see MsgNotifierPrivate.h |
|
345 |
// ---------------------------------------------------------------------------- |
|
346 |
bool MsgNotifierPrivate::showNotification(int receivedMsgConvId) |
|
347 |
{ |
|
348 |
bool showNotification = true; |
|
349 |
||
350 |
RWsSession wsSession ; |
|
351 |
wsSession.Connect(); |
|
352 |
||
353 |
TApaTaskList taskList( wsSession ); |
|
354 |
TApaTask task = taskList.FindApp(KMsgAppUid); // find msgapp is running |
|
355 |
||
356 |
if(task.Exists()) |
|
357 |
{ |
|
358 |
TApaTask foregndtask = taskList.FindByPos(0) ; // foreground app |
|
359 |
// compare window group id |
|
360 |
// if application is in foregorund, then check the currently |
|
361 |
// opened conversation is same as received one. |
|
362 |
if(task.WgId() == foregndtask.WgId() ) |
|
363 |
{ |
|
364 |
// get the current conversation ID |
|
365 |
XQPublishAndSubscribeSettingsKey convIdKey( KMsgCVIdProperty, |
|
366 |
KMsgCVIdKey); |
|
367 |
QVariant value = mSettingsManager->readItemValue(convIdKey, |
|
368 |
XQSettingsManager::TypeInt); |
|
369 |
||
370 |
int openedConvId = value.toInt(); |
|
371 |
if( openedConvId == receivedMsgConvId) |
|
372 |
{ |
|
373 |
showNotification = false; |
|
374 |
QDEBUG_WRITE("processListEntry : Notification not shown") |
|
375 |
} |
|
376 |
} |
|
377 |
} |
|
378 |
||
379 |
wsSession.Close(); |
|
380 |
return showNotification; |
|
381 |
} |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
382 |
// ---------------------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
383 |
// MsgNotifierPrivate::PartialDeleteConversationList |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
384 |
// @see mcsconversationclientchangeobserver.h |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
385 |
// ---------------------------------------------------------------------------- |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
386 |
void MsgNotifierPrivate::PartialDeleteConversationList( |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
387 |
const CCsClientConversation& aClientConversation){/*empty implementation*/} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
388 |
|
31 | 389 |
//EOF |