summaryrefslogtreecommitdiffabout
path: root/libkdepim/externalapphandler.cpp
authorzautrix <zautrix>2004-09-17 09:46:54 (UTC)
committer zautrix <zautrix>2004-09-17 09:46:54 (UTC)
commit9421138854b85a9baced09649f617118502610c1 (patch) (unidiff)
treea7f78207de34e2b67d3a4709531714cb848f3d16 /libkdepim/externalapphandler.cpp
parent6341e161c5af4e5ac1d1d3ec9fdabf04b287800f (diff)
downloadkdepimpi-9421138854b85a9baced09649f617118502610c1.zip
kdepimpi-9421138854b85a9baced09649f617118502610c1.tar.gz
kdepimpi-9421138854b85a9baced09649f617118502610c1.tar.bz2
Fixed bug externalapphandler
Diffstat (limited to 'libkdepim/externalapphandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index fa56ee9..99aee86 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -76,17 +76,17 @@ QCopTransferItem::QCopTransferItem()
76/*********************************************************************************/ 76/*********************************************************************************/
77bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3) 77bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& param1, const QString& param2, const QString& param3)
78{ 78{
79 79
80#ifndef DESKTOP_VERSION 80#ifndef DESKTOP_VERSION
81 //sourceMessage passes two parameters: sourceChannel, uid 81 //sourceMessage passes two parameters: sourceChannel, uid
82 QString sourceMessage = _sourceMessage + _sourceMessageParameters; 82 QString sourceMessage = _sourceMessage + _sourceMessageParameters;
83 83
84 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1()); 84 qDebug("1Using QCopEnvelope e(\"%s\",\"%s\")", _targetChannel.latin1(), sourceMessage.latin1());
85 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1()); 85 qDebug("passing sourcechannel(%s), uid(%s), param1(%s), param2(%s), param3(%s) as parameter to QCopEnvelope", _sourceChannel.latin1(), uid.latin1(), param1.latin1(), param2.latin1(), param3.latin1());
86 86
87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1()); 87 QCopEnvelope e(_targetChannel.latin1(), sourceMessage.latin1());
88 88
89 e << _sourceChannel << uid; 89 e << _sourceChannel << uid;
90 90
91 if (_usedSourceParameters == 1) 91 if (_usedSourceParameters == 1)
92 e << param1; 92 e << param1;
@@ -106,18 +106,18 @@ bool QCopTransferItem::sendMessageToTarget(const QString& uid, const QString& pa
106 106
107} 107}
108 108
109 109
110/*********************************************************************************/ 110/*********************************************************************************/
111void QCopTransferItem::setSourceChannel(const QString& sourceChannel) 111void QCopTransferItem::setSourceChannel(const QString& sourceChannel)
112{ 112{
113 113
114 if (_sourceChannel.isEmpty()) 114 if ( !sourceChannel.isEmpty())
115 _sourceChannel = sourceChannel; 115 _sourceChannel = sourceChannel;
116} 116}
117 117
118 118
119/*********************************************************************************/ 119/*********************************************************************************/
120bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 120bool QCopTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
121{ 121{
122 122
123 // copied from old mail2 123 // copied from old mail2
@@ -192,17 +192,17 @@ QCopMapTransferItem::QCopMapTransferItem(int usedSourceParameters, const QString
192 192
193/*********************************************************************************/ 193/*********************************************************************************/
194bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap) 194bool QCopMapTransferItem::sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap)
195{ 195{
196#ifndef DESKTOP_VERSION 196#ifndef DESKTOP_VERSION
197 //targetMessage passes two parameters: uid, map 197 //targetMessage passes two parameters: uid, map
198 QString targetMessage = _targetMessage + _targetMessageParameters; 198 QString targetMessage = _targetMessage + _targetMessageParameters;
199 199
200 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 200 qDebug("2Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
201 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1()); 201 qDebug("passing uid(%s) and map as parameter to QCopEnvelope", uid.latin1());
202 202
203 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 203 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
204 //US we need no names in the To field. The emailadresses are enough 204 //US we need no names in the To field. The emailadresses are enough
205 205
206 e << uid << nameEmailMap; 206 e << uid << nameEmailMap;
207 207
208 qApp->processEvents(); 208 qApp->processEvents();
@@ -261,17 +261,17 @@ QCopListTransferItem::QCopListTransferItem(int usedSourceParameters, const QStri
261 261
262/*********************************************************************************/ 262/*********************************************************************************/
263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 263bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
264{ 264{
265#ifndef DESKTOP_VERSION 265#ifndef DESKTOP_VERSION
266 //targetMessage passes two parameters: uid, map 266 //targetMessage passes two parameters: uid, map
267 QString targetMessage = _targetMessage + _targetMessageParameters; 267 QString targetMessage = _targetMessage + _targetMessageParameters;
268 268
269 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1()); 269 qDebug("3Using QCopEnvelope e(\"%s\",\"%s\")", _sourceChannel.latin1(), targetMessage.latin1());
270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1()); 270 qDebug("passing uid(%s) and list1, list2, list3 as parameter to QCopEnvelope", uid.latin1());
271 271
272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1()); 272 QCopEnvelope e(_sourceChannel.latin1(), targetMessage.latin1());
273 //US we need no names in the To field. The emailadresses are enough 273 //US we need no names in the To field. The emailadresses are enough
274 274
275 e << uid << list1 << list2 << list3; 275 e << uid << list1 << list2 << list3;
276 276
277 qApp->processEvents(); 277 qApp->processEvents();
@@ -285,22 +285,23 @@ bool QCopListTransferItem::sendMessageToSource(const QString& uid, const QString
285 285
286} 286}
287 287
288 288
289/*********************************************************************************/ 289/*********************************************************************************/
290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data ) 290bool QCopListTransferItem::appMessage( const QCString& cmsg, const QByteArray& data )
291{ 291{
292 bool res = QCopTransferItem::appMessage( cmsg, data ); 292 bool res = QCopTransferItem::appMessage( cmsg, data );
293 qDebug("1QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
293 294
294 if (res == false) 295 if (res == false)
295 { 296 {
296 QDataStream stream( data, IO_ReadOnly ); 297 QDataStream stream( data, IO_ReadOnly );
297 298
298// qDebug("QCopListTransferItem- QCOP message received: %s ", cmsg.data() ); 299 qDebug("2QCopListTransferItem- QCOP message received: %s ", cmsg.data() );
299 300
300 //we are in the source and get an answer from the target 301 //we are in the source and get an answer from the target
301 if ((_targetMessage + _targetMessageParameters) == cmsg.data()) 302 if ((_targetMessage + _targetMessageParameters) == cmsg.data())
302 { 303 {
303 QStringList list1; 304 QStringList list1;
304 QStringList list2; 305 QStringList list2;
305 QStringList list3; 306 QStringList list3;
306 QString uid; 307 QString uid;
@@ -599,17 +600,17 @@ bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QS
599 message2 = dai->_message2; 600 message2 = dai->_message2;
600 parameters2 = dai->_parameters2; 601 parameters2 = dai->_parameters2;
601 } 602 }
602 603
603 //first check if one of the mailers need the emails right in the message. 604 //first check if one of the mailers need the emails right in the message.
604 message2 = translateMessage(message2, emails, urls); 605 message2 = translateMessage(message2, emails, urls);
605 606
606 607
607 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); 608 qDebug("4Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1());
608 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); 609 qDebug("passing emailadresses(%s), attachmenturls(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1());
609 610
610 611
611 QCopEnvelope e(channel.latin1(), message2.latin1()); 612 QCopEnvelope e(channel.latin1(), message2.latin1());
612 //US we need no names in the To field. The emailadresses are enough 613 //US we need no names in the To field. The emailadresses are enough
613 614
614 passParameters(&e, parameters2, emails, urls); 615 passParameters(&e, parameters2, emails, urls);
615 616
@@ -656,17 +657,17 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
656 parameters = dai->_parameters; 657 parameters = dai->_parameters;
657 } 658 }
658 659
659 660
660 //first check if one of the mailers need the emails right in the message. 661 //first check if one of the mailers need the emails right in the message.
661 message = translateMessage(message, name, emailadress); 662 message = translateMessage(message, name, emailadress);
662 663
663 664
664 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 665 qDebug("5Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
665 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); 666 qDebug("passing name(%s), emailadresses(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1());
666 667
667 QCopEnvelope e(channel.latin1(), message.latin1()); 668 QCopEnvelope e(channel.latin1(), message.latin1());
668 //US we need no names in the To field. The emailadresses are enough 669 //US we need no names in the To field. The emailadresses are enough
669 670
670 passParameters(&e, parameters, name, emailadress); 671 passParameters(&e, parameters, name, emailadress);
671 672
672 673
@@ -733,17 +734,17 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber )
733 parameters = dai->_parameters; 734 parameters = dai->_parameters;
734 } 735 }
735 736
736 737
737 //first check if one of the mailers need the emails right in the message. 738 //first check if one of the mailers need the emails right in the message.
738 message = translateMessage(message, phonenumber, ""); 739 message = translateMessage(message, phonenumber, "");
739 740
740 741
741 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 742 qDebug("6Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
742 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 743 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
743 744
744 QCopEnvelope e(channel.latin1(), message.latin1()); 745 QCopEnvelope e(channel.latin1(), message.latin1());
745 //US we need no names in the To field. The emailadresses are enough 746 //US we need no names in the To field. The emailadresses are enough
746 747
747 passParameters(&e, parameters, phonenumber, ""); 748 passParameters(&e, parameters, phonenumber, "");
748 749
749 750
@@ -788,17 +789,17 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber )
788 parameters = dai->_parameters; 789 parameters = dai->_parameters;
789 } 790 }
790 791
791 792
792 //first check if one of the mailers need the emails right in the message. 793 //first check if one of the mailers need the emails right in the message.
793 message = translateMessage(message, phonenumber, ""); 794 message = translateMessage(message, phonenumber, "");
794 795
795 796
796 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 797 qDebug("7Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
797 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1()); 798 qDebug("passing phonenumber(%s) as parameter in the form %s to QCopEnvelope", phonenumber.latin1(), parameters.latin1());
798 799
799 QCopEnvelope e(channel.latin1(), message.latin1()); 800 QCopEnvelope e(channel.latin1(), message.latin1());
800 //US we need no names in the To field. The emailadresses are enough 801 //US we need no names in the To field. The emailadresses are enough
801 802
802 passParameters(&e, parameters, phonenumber, ""); 803 passParameters(&e, parameters, phonenumber, "");
803 804
804 805
@@ -843,17 +844,17 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber )
843 parameters = dai->_parameters; 844 parameters = dai->_parameters;
844 } 845 }
845 846
846 847
847 //first check if one of the mailers need the emails right in the message. 848 //first check if one of the mailers need the emails right in the message.
848 message = translateMessage(message, pagernumber, ""); 849 message = translateMessage(message, pagernumber, "");
849 850
850 851
851 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 852 qDebug("8Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
852 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1()); 853 qDebug("passing pagernumber(%s) as parameter in the form %s to QCopEnvelope", pagernumber.latin1(), parameters.latin1());
853 854
854 QCopEnvelope e(channel.latin1(), message.latin1()); 855 QCopEnvelope e(channel.latin1(), message.latin1());
855 //US we need no names in the To field. The emailadresses are enough 856 //US we need no names in the To field. The emailadresses are enough
856 857
857 passParameters(&e, parameters, pagernumber, ""); 858 passParameters(&e, parameters, pagernumber, "");
858 859
859 860
@@ -898,17 +899,17 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber )
898 parameters = dai->_parameters; 899 parameters = dai->_parameters;
899 } 900 }
900 901
901 902
902 //first check if one of the mailers need the emails right in the message. 903 //first check if one of the mailers need the emails right in the message.
903 message = translateMessage(message, faxnumber, ""); 904 message = translateMessage(message, faxnumber, "");
904 905
905 906
906 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 907 qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
907 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1()); 908 qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1());
908 909
909 QCopEnvelope e(channel.latin1(), message.latin1()); 910 QCopEnvelope e(channel.latin1(), message.latin1());
910 //US we need no names in the To field. The emailadresses are enough 911 //US we need no names in the To field. The emailadresses are enough
911 912
912 passParameters(&e, parameters, faxnumber, ""); 913 passParameters(&e, parameters, faxnumber, "");
913 914
914 915
@@ -953,17 +954,17 @@ bool ExternalAppHandler::callBySIP( const QString& sipnumber )
953 parameters = dai->_parameters; 954 parameters = dai->_parameters;
954 } 955 }
955 956
956 957
957 //first check if one of the sip apps need the emails right in the message. 958 //first check if one of the sip apps need the emails right in the message.
958 message = translateMessage(message, sipnumber, ""); 959 message = translateMessage(message, sipnumber, "");
959 960
960 961
961 qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); 962 qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1());
962 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); 963 qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1());
963 964
964 QCopEnvelope e(channel.latin1(), message.latin1()); 965 QCopEnvelope e(channel.latin1(), message.latin1());
965 //US we need no names in the To field. The emailadresses are enough 966 //US we need no names in the To field. The emailadresses are enough
966 967
967 passParameters(&e, parameters, sipnumber, ""); 968 passParameters(&e, parameters, sipnumber, "");
968 969
969 970
@@ -1059,16 +1060,17 @@ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& dat
1059bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) 1060bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
1060{ 1061{
1061 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 1062 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
1062 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); 1063 return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid);
1063} 1064}
1064 1065
1065bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) 1066bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3)
1066{ 1067{
1068
1067 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); 1069 mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
1068 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3); 1070 return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3);
1069} 1071}
1070 1072
1071bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) 1073bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email)
1072{ 1074{
1073 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); 1075 mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel);
1074 return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); 1076 return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email);