messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
changeset 44 36f374c67aa8
parent 43 35b64624a9e7
child 47 5b14749788d7
child 52 12db4185673b
equal deleted inserted replaced
43:35b64624a9e7 44:36f374c67aa8
    26 #include <w32std.h>
    26 #include <w32std.h>
    27 #include <apgtask.h> 
    27 #include <apgtask.h> 
    28 #include <XQSettingsManager>
    28 #include <XQSettingsManager>
    29 #include <xqpublishandsubscribeutils.h>
    29 #include <xqpublishandsubscribeutils.h>
    30 #include <xqsystemtoneservice.h>
    30 #include <xqsystemtoneservice.h>
       
    31 #include <xqconversions.h>
    31 
    32 
    32 //USER INCLUDES
    33 //USER INCLUDES
    33 #include "msgnotifier.h"
    34 #include "msgnotifier.h"
    34 #include "msgnotifier_p.h"
    35 #include "msgnotifier_p.h"
    35 #include <xqconversions.h>
       
    36 #include "msgstorehandler.h"
    36 #include "msgstorehandler.h"
    37 #include "msginfodefs.h"
    37 #include "msginfodefs.h"
    38 #include "conversationidpsconsts.h"
    38 #include "conversationidpsconsts.h"
    39 #include "debugtraces.h"
    39 #include "debugtraces.h"
    40 
       
    41 
    40 
    42 // ----------------------------------------------------------------------------
    41 // ----------------------------------------------------------------------------
    43 // MsgNotifierPrivate::MsgNotifierPrivate
    42 // MsgNotifierPrivate::MsgNotifierPrivate
    44 // @see MsgNotifierPrivate.h
    43 // @see MsgNotifierPrivate.h
    45 // ----------------------------------------------------------------------------
    44 // ----------------------------------------------------------------------------
   299 // ----------------------------------------------------------------------------
   298 // ----------------------------------------------------------------------------
   300 // MsgNotifierPrivate::displayFailedNote
   299 // MsgNotifierPrivate::displayFailedNote
   301 // @see MsgNotifierPrivate.h
   300 // @see MsgNotifierPrivate.h
   302 // ----------------------------------------------------------------------------
   301 // ----------------------------------------------------------------------------
   303 void MsgNotifierPrivate::displayFailedNote(MsgInfo info)
   302 void MsgNotifierPrivate::displayFailedNote(MsgInfo info)
   304 {
   303     {
   305     // TODO: use XQAiwRequest
   304     QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote start.")
   306     QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : entered")
   305             
   307     // change to com.nokia.symbian.messaging (servicename), IMsgErrorNotifier
   306     // check whether opened cv id and received 
   308     // as the service name.
   307     // cv id are same then dont show failed note
   309     XQServiceRequest snd("messaging.com.nokia.symbian.MsgErrorNotifier",
   308     if (!showNotification(info.mConversationId))
   310         "displayErrorNote(QVariantList)", false);
   309         {
   311 
   310         return;
   312     QVariantList args;
   311         }
       
   312 
       
   313     //Even if name string is empty we shall add name into args
       
   314     QString nameString;
       
   315 
   313     info.mDisplayName.removeDuplicates();
   316     info.mDisplayName.removeDuplicates();
   314     info.mDisplayName.sort();
   317     info.mDisplayName.sort();
   315     
   318 
   316     QString nameString;
       
   317     
       
   318     nameString.append(info.mDisplayName.at(0));
   319     nameString.append(info.mDisplayName.at(0));
   319     for(int i = 1; i < info.mDisplayName.count(); ++i){
   320     for (int i = 1; i < info.mDisplayName.count(); ++i)
       
   321         {
   320         nameString.append(", ");
   322         nameString.append(", ");
   321         nameString.append(info.mDisplayName.at(i));
   323         nameString.append(info.mDisplayName.at(i));
   322     }
   324         }
   323       
   325 
   324     //Even if name string is empty we shall add name into args
   326     // create request arguments
   325     QVariant nameV(nameString);
   327     QVariantList args;
   326     args << nameV;
   328     args << QVariant(nameString);
   327 
       
   328     QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : name and contactnumber")
       
   329 
       
   330     args << info.mConversationId;
   329     args << info.mConversationId;
   331     args << info.mMessageType;
   330     args << info.mMessageType;
       
   331 
       
   332     // TODO: use XQAiwRequest
       
   333     XQServiceRequest snd("messaging.com.nokia.symbian.MsgErrorNotifier",
       
   334             "displayErrorNote(QVariantList)", false);
       
   335 
   332     snd << args;
   336     snd << args;
   333     snd.send();
   337     snd.send();
   334     QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : left")
   338     
   335 
   339     QDEBUG_WRITE("MsgNotifierPrivate::displayFailedNote end.")
   336 }
   340     }
   337 
   341 
   338 // ----------------------------------------------------------------------------
   342 // ----------------------------------------------------------------------------
   339 // MsgNotifierPrivate::showNotification
   343 // MsgNotifierPrivate::showNotification
   340 // @see MsgNotifierPrivate.h
   344 // @see MsgNotifierPrivate.h
   341 // ----------------------------------------------------------------------------
   345 // ----------------------------------------------------------------------------
   373         }
   377         }
   374 
   378 
   375     wsSession.Close();
   379     wsSession.Close();
   376     return showNotification;
   380     return showNotification;
   377 }
   381 }
       
   382 // ----------------------------------------------------------------------------
       
   383 // MsgNotifierPrivate::PartialDeleteConversationList
       
   384 // @see mcsconversationclientchangeobserver.h
       
   385 // ----------------------------------------------------------------------------
       
   386 void MsgNotifierPrivate::PartialDeleteConversationList(
       
   387         const CCsClientConversation& aClientConversation){/*empty implementation*/}
       
   388 
   378 //EOF
   389 //EOF