From: Kate Alhola Date: Wed, 26 May 2010 17:01:51 +0000 (+0300) Subject: message queued tested X-Git-Url: http://git.maemo.org/git/?p=tpsession;a=commitdiff_plain;h=f923941a11132697d5bd1968cbbb9c328f090423 message queued tested --- diff --git a/tpsession-0.1/Makefile b/tpsession-0.1/Makefile index e2becfb..6a5fac0 100644 --- a/tpsession-0.1/Makefile +++ b/tpsession-0.1/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: tpsession -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:27:46 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:19 2010 # Project: tpsession.pro # Template: subdirs # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tpsession.pro diff --git a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control index 4bb5b62..2ea089c 100644 --- a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control +++ b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/control @@ -4,7 +4,7 @@ Section: libdevel Priority: extra Architecture: armel Depends: tpsession -Installed-Size: 894 +Installed-Size: 900 Maintainer: Kate Alhola Source: tpsession Description: Easy to use API to Telepathy-Qt4 debug symbols diff --git a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums index b367845..c16fd04 100644 --- a/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession-dbg/DEBIAN/md5sums @@ -1,3 +1,3 @@ -abf7dc098c9ab93af0b7cf66c8a57927 usr/lib/debug/usr/lib/libtpsession.so.0.1.0 -76fabb1b886f434c90b04f1229c84b75 usr/share/doc/libtpsession-dbg/changelog.Debian.gz +279d55edf2dbbaa8a9ef9e80e6afa950 usr/lib/debug/usr/lib/libtpsession.so.0.1.0 +7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession-dbg/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession-dbg/copyright diff --git a/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz index 93c3317..a6b6899 100644 Binary files a/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession-dbg/usr/share/doc/libtpsession-dbg/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums index f2b1626..d0934ee 100644 --- a/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession-dev/DEBIAN/md5sums @@ -1,7 +1,7 @@ f5dc0a769f2e6fb59be9c66b55b738ad usr/include/telepathy-1.0/tpsession/tpsession.h -500e045bff6fe974334a1e6ede7df235 usr/include/telepathy-1.0/tpsession/tpsessionaccount.h -c71b18e6d08b33ab9bfdd9fd98816704 usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +91a79511e7fde9bf828b69f2479a8c10 usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +1db2a0ee688a22591395915a69840c00 usr/include/telepathy-1.0/tpsession/tpsessionchannel.h da668240e6a6465d26576272ecb52b48 usr/include/telepathy-1.0/tpsession/tpsessionobserver.h 4987dc18c04e1e486b0c518dcd0ef913 usr/lib/pkgconfig/TpSession.pc -76fabb1b886f434c90b04f1229c84b75 usr/share/doc/libtpsession-dev/changelog.Debian.gz +7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession-dev/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession-dev/copyright diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h index b6b258b..598aab9 100644 --- a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h @@ -45,7 +45,7 @@ class TpSessionAccount:public QObject Q_OBJECT public: TpSessionAccount(Tp::AccountManagerPtr am,const QString &objectPath); - void makeContactFromAddress(QString address); + bool makeContactFromAddress(QString address); void sendMessageToAddress(QString address,QString message); Tp::ContactPtr getContactFromAddress(QString address); void addOutgoingChannel(const Tp::ContactPtr &contact); @@ -54,9 +54,11 @@ public: signals: void accountReady(TpSessionAccount *); void channelReady(TpSessionAccount *); + void messageQueued(TpSessionAccount *,bool); void messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *); void messageSent(const Tp::Message &,TpSessionAccount *); void newChannel(TpSessionAccount *,QString,QString,const Tp::ChannelDetails &); + void contactRetrieved(Tp::ContactPtr,bool,bool); private slots: void onReady(Tp::PendingOperation *op); @@ -64,7 +66,7 @@ private slots: void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); - void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); + void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *); void onNewChannels(const Tp::ChannelDetailsList&); public: bool ready; diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h index cf71af0..44db8ea 100644 --- a/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/debian/libtpsession-dev/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h @@ -41,6 +41,8 @@ public: TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr &contact); void sendMessage(QString message); QString peerId(); + QString objectPath(); + QString type(); signals: void channelReady(TpSessionChannel *); void channelDestroyed(TpSessionChannel *); diff --git a/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz index 93c3317..a6b6899 100644 Binary files a/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession-dev/usr/share/doc/libtpsession-dev/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/libtpsession/DEBIAN/control b/tpsession-0.1/debian/libtpsession/DEBIAN/control index 2e08bd6..fd0f4c9 100644 --- a/tpsession-0.1/debian/libtpsession/DEBIAN/control +++ b/tpsession-0.1/debian/libtpsession/DEBIAN/control @@ -4,7 +4,7 @@ Section: libs Priority: extra Architecture: armel Depends: libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100310), libqt4-dbus (>= 4.6.2~git20100310), libqt4-network (>= 4.6.2~git20100310), libqt4-xml (>= 4.6.2~git20100310), libstdc++6 (>= 4.2.1) -Installed-Size: 62 +Installed-Size: 64 Maintainer: Kate Alhola Source: tpsession Description: Easy to use API to Telepathy-Qt4 diff --git a/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums b/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums index 45bbf53..81508bd 100644 --- a/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums +++ b/tpsession-0.1/debian/libtpsession/DEBIAN/md5sums @@ -1,4 +1,4 @@ -771a90e449537f4fd4f9ccacc0ea2492 usr/lib/libtpsession.so.0.1.0 -76fabb1b886f434c90b04f1229c84b75 usr/share/doc/libtpsession/changelog.Debian.gz +3550dafd99a7f78a42d7822e2bf13c6c usr/lib/libtpsession.so.0.1.0 +7db70a8516956741d44ddbd4ab9e664a usr/share/doc/libtpsession/changelog.Debian.gz 707f20563222a064607acf41d3e5c7b2 usr/share/doc/libtpsession/copyright 566711be92c93313ec96c77fe9477c68 usr/share/doc/libtpsession/README.Debian diff --git a/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz b/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz index 93c3317..a6b6899 100644 Binary files a/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz and b/tpsession-0.1/debian/libtpsession/usr/share/doc/libtpsession/changelog.Debian.gz differ diff --git a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h index b6b258b..598aab9 100644 --- a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionaccount.h @@ -45,7 +45,7 @@ class TpSessionAccount:public QObject Q_OBJECT public: TpSessionAccount(Tp::AccountManagerPtr am,const QString &objectPath); - void makeContactFromAddress(QString address); + bool makeContactFromAddress(QString address); void sendMessageToAddress(QString address,QString message); Tp::ContactPtr getContactFromAddress(QString address); void addOutgoingChannel(const Tp::ContactPtr &contact); @@ -54,9 +54,11 @@ public: signals: void accountReady(TpSessionAccount *); void channelReady(TpSessionAccount *); + void messageQueued(TpSessionAccount *,bool); void messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *); void messageSent(const Tp::Message &,TpSessionAccount *); void newChannel(TpSessionAccount *,QString,QString,const Tp::ChannelDetails &); + void contactRetrieved(Tp::ContactPtr,bool,bool); private slots: void onReady(Tp::PendingOperation *op); @@ -64,7 +66,7 @@ private slots: void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); - void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); + void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *); void onNewChannels(const Tp::ChannelDetailsList&); public: bool ready; diff --git a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h index cf71af0..44db8ea 100644 --- a/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/debian/tmp/usr/include/telepathy-1.0/tpsession/tpsessionchannel.h @@ -41,6 +41,8 @@ public: TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr &contact); void sendMessage(QString message); QString peerId(); + QString objectPath(); + QString type(); signals: void channelReady(TpSessionChannel *); void channelDestroyed(TpSessionChannel *); diff --git a/tpsession-0.1/tests/Makefile b/tpsession-0.1/tests/Makefile index f51f3f1..ef018eb 100644 --- a/tpsession-0.1/tests/Makefile +++ b/tpsession-0.1/tests/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: tests -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:28:10 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:25 2010 # Project: tests.pro # Template: subdirs # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tests.pro diff --git a/tpsession-0.1/tests/showaccounts/Makefile b/tpsession-0.1/tests/showaccounts/Makefile index 888a299..c2a76f0 100644 --- a/tpsession-0.1/tests/showaccounts/Makefile +++ b/tpsession-0.1/tests/showaccounts/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: showaccounts -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:28:31 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:46 2010 # Project: showaccounts.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile showaccounts.pro diff --git a/tpsession-0.1/tests/showaccounts/showaccounts b/tpsession-0.1/tests/showaccounts/showaccounts index c9e02c5..d9ffdbe 100755 Binary files a/tpsession-0.1/tests/showaccounts/showaccounts and b/tpsession-0.1/tests/showaccounts/showaccounts differ diff --git a/tpsession-0.1/tests/smstest/Makefile b/tpsession-0.1/tests/smstest/Makefile index 3b77770..89e1864 100644 --- a/tpsession-0.1/tests/smstest/Makefile +++ b/tpsession-0.1/tests/smstest/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: smstest -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:28:10 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:25 2010 # Project: smstest.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile smstest.pro diff --git a/tpsession-0.1/tests/smstest/smstest b/tpsession-0.1/tests/smstest/smstest index cd322fb..56c9865 100755 Binary files a/tpsession-0.1/tests/smstest/smstest and b/tpsession-0.1/tests/smstest/smstest differ diff --git a/tpsession-0.1/tests/smstest/smstest.pro.user b/tpsession-0.1/tests/smstest/smstest.pro.user index ed0a03c..e4a9990 100644 --- a/tpsession-0.1/tests/smstest/smstest.pro.user +++ b/tpsession-0.1/tests/smstest/smstest.pro.user @@ -1,230 +1,113 @@ - RunConfiguration0-CommandLineArguments - - - - RunConfiguration0-ProFile - /Users/kate/scratchbox/fremantle/tpsession/tests/smstest/smstest.pro - - - RunConfiguration0-RunConfiguration.name - smstest - - - RunConfiguration0-UserSetName - false - - - RunConfiguration0-type - Qt4ProjectManager.Qt4RunConfiguration - - - activeRunConfiguration - 0 - - - activebuildconfiguration - Debug - - - buildConfiguration-Debug - - Debug - 0 - - /Users/kate/scratchbox/fremantle/tpsession/tests/smstest - - - - buildConfiguration-Release - - Release - 0 - - - - - buildconfiguration-Debug-buildstep0 - - Debug - - - - buildconfiguration-Debug-buildstep1 - - Debug - - Apple_PubSub_Socket_Render=/tmp/launch-SZ7gJm/Render - COMMAND_MODE=legacy - CrashReporterRelaunched=1 - DISPLAY=/tmp/launch-WAqOyv/:0 - HOME=/Users/kate - LOGNAME=kate - PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin - QTDIR=/usr - RelaunchedApplicationBundleID=com.nokia.qtcreator - SHELL=/bin/bash - SSH_AUTH_SOCK=/tmp/launch-2S4qM9/Listeners - TMPDIR=/var/folders/m4/m4-87MXMGFaQCKn+y3s6SU+++TI/-Tmp-/ - USER=kate - __CF_USER_TEXT_ENCODING=0x1F5:0:0 - __LAUNCHD_FD=28 - - - /Users/kate/scratchbox/fremantle/tpsession/tests/smstest/smstest.pro - -spec - macx-g++ - -r - CONFIG+=debug_and_release - - /usr/bin/qmake - true - /Users/kate/scratchbox/fremantle/tpsession/tests/smstest - 10 - - - - buildconfiguration-Debug-buildstep2 - - Debug - - Apple_PubSub_Socket_Render=/tmp/launch-SZ7gJm/Render - COMMAND_MODE=legacy - CrashReporterRelaunched=1 - DISPLAY=/tmp/launch-WAqOyv/:0 - HOME=/Users/kate - LOGNAME=kate - PATH=/Developer/Tools/Qt:/usr/bin:/bin:/usr/sbin:/sbin - QTDIR=/usr - RelaunchedApplicationBundleID=com.nokia.qtcreator - SHELL=/bin/bash - SSH_AUTH_SOCK=/tmp/launch-2S4qM9/Listeners - TMPDIR=/var/folders/m4/m4-87MXMGFaQCKn+y3s6SU+++TI/-Tmp-/ - USER=kate - __CF_USER_TEXT_ENCODING=0x1F5:0:0 - __LAUNCHD_FD=28 - - - debug - -w - - /usr/bin/make - true - /Users/kate/scratchbox/fremantle/tpsession/tests/smstest - - debug - - - - - buildconfiguration-Debug-cleanstep0 - - Debug - - - - buildconfiguration-Debug-cleanstep1 - - Debug - - - - buildconfiguration-Release-buildstep0 - - Release - - - - buildconfiguration-Release-buildstep1 - - Release - 8 - - - - buildconfiguration-Release-buildstep2 - - Release - - release - - - - - buildconfiguration-Release-cleanstep0 - - Release - - - - buildconfiguration-Release-cleanstep1 - - Release - - - - buildconfigurations - - Debug - Release - - - - buildstep0 - - - - - - buildstep1 - - - - - - - buildstep2 - - - - - - buildsteps - - trolltech.qt4projectmanager.gdbmaros - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make - - - - cleanstep0 - - - true - - - - cleanstep1 - - - true - - - - cleansteps - - trolltech.qt4projectmanager.gdbmaros - trolltech.qt4projectmanager.make - - - - defaultFileEncoding - System - - - project - + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + debug + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /Users/kate/scratchbox/fremantle/tpsession/tests/smstest + 2 + 0 + true + + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + release + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /mnt/hgfs/scratchbox/fremantle/tpsession/tpsession-0.1/tests/smstest-build-desktop + 2 + 0 + true + + 2 + + smstest + Qt4ProjectManager.Qt4RunConfiguration + 2 + + ../../../../../../../../Users/kate/scratchbox/fremantle/tpsession/tests/smstest/smstest.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 diff --git a/tpsession-0.1/tests/smstest/testprog.cpp b/tpsession-0.1/tests/smstest/testprog.cpp index 69f2385..9a9f85d 100644 --- a/tpsession-0.1/tests/smstest/testprog.cpp +++ b/tpsession-0.1/tests/smstest/testprog.cpp @@ -10,11 +10,13 @@ TestProg::TestProg(QString addr,QString msg) connect(tps,SIGNAL(accountReady(TpSessionAccount *)),SLOT(onAccountReady(TpSessionAccount *))); connect(tps,SIGNAL(messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *)), SLOT(onMessageReceived(const Tp::ReceivedMessage &,TpSessionAccount *))); + } void TestProg::onAccountReady(TpSessionAccount *tpsa) { qDebug() << __PRETTY_FUNCTION__ ; + connect(tpsa,SIGNAL(messageQueued(TpSessionAccount *,bool)),SLOT(onMessageQueued(TpSessionAccount *,bool))); tpsa->sendMessageToAddress(address,message); }; @@ -22,3 +24,7 @@ void TestProg::onMessageReceived(const Tp::ReceivedMessage &msg,TpSessionAccount { qDebug() << "TestProg::onMessageReceived " << msg.text() << "from " << msg.sender()->id(); } +void TestProg::onMessageQueued(TpSessionAccount *acc,bool status) +{ + qDebug() << "TestProg::onMessageQueued " << status; +} diff --git a/tpsession-0.1/tests/smstest/testprog.h b/tpsession-0.1/tests/smstest/testprog.h index 9bd16dc..f30aa09 100644 --- a/tpsession-0.1/tests/smstest/testprog.h +++ b/tpsession-0.1/tests/smstest/testprog.h @@ -15,6 +15,7 @@ public: public slots: void onAccountReady(TpSessionAccount *); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionAccount *); + void onMessageQueued(TpSessionAccount *acc,bool status); private: QString address; QString message; diff --git a/tpsession-0.1/tests/syncsms/Makefile b/tpsession-0.1/tests/syncsms/Makefile index 72079f7..dfbc87a 100644 --- a/tpsession-0.1/tests/syncsms/Makefile +++ b/tpsession-0.1/tests/syncsms/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: syncsms -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:28:20 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:36 2010 # Project: syncsms.pro # Template: app # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile syncsms.pro diff --git a/tpsession-0.1/tests/syncsms/syncsms b/tpsession-0.1/tests/syncsms/syncsms index 09c347d..c08b51b 100755 Binary files a/tpsession-0.1/tests/syncsms/syncsms and b/tpsession-0.1/tests/syncsms/syncsms differ diff --git a/tpsession-0.1/tpsession/Makefile b/tpsession-0.1/tpsession/Makefile index 264d3e4..b7a7809 100644 --- a/tpsession-0.1/tpsession/Makefile +++ b/tpsession-0.1/tpsession/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: libtpsession.so.0.1.0 -# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon May 10 14:27:47 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed May 26 19:59:20 2010 # Project: tpsession.pro # Template: lib # Command: /usr/bin/qmake -unix QMAKE_CC\ =\ cc QMAKE_CXX\ =\ g++ QMAKE_CFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 QMAKE_CXXFLAGS_RELEASE\ =\ \ -g\ -Wall\ -O2 -o Makefile tpsession.pro diff --git a/tpsession-0.1/tpsession/libtpsession.so.0.1.0 b/tpsession-0.1/tpsession/libtpsession.so.0.1.0 index fd17303..f0ee294 100755 Binary files a/tpsession-0.1/tpsession/libtpsession.so.0.1.0 and b/tpsession-0.1/tpsession/libtpsession.so.0.1.0 differ diff --git a/tpsession-0.1/tpsession/tpsession.cpp b/tpsession-0.1/tpsession/tpsession.cpp index 1e46b7b..20a69cd 100644 --- a/tpsession-0.1/tpsession/tpsession.cpp +++ b/tpsession-0.1/tpsession/tpsession.cpp @@ -101,6 +101,7 @@ TpSession* TpSession::instance(bool synchronous) void TpSession::onAMReady(Tp::PendingOperation *op) { + Q_UNUSED(op); // qDebug() << "TpSession::onAMReady"; TpSessionAccount *tpacc; @@ -124,7 +125,7 @@ void TpSession::onAccountCreated(const QString &path) void TpSession::onAccountReady(TpSessionAccount *tpacc) { - qDebug() << "TpSession::onAccountReady:Account " << tpacc->acc->cmName() << "is Ready sync=" << sync << "waiting:" << reqCm; + //qDebug() << "TpSession::onAccountReady:Account " << tpacc->acc->cmName() << "is Ready sync=" << sync << "waiting:" << reqCm; connect(tpacc,SIGNAL(messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *)), SLOT(onMessageReceived(const Tp::ReceivedMessage &,TpSessionAccount *))); if(!reqCm.isEmpty() && tpacc->acc->cmName()==reqCm) { @@ -201,8 +202,7 @@ void TpSession::createObserver() bool registered = registrar->registerClient( Tp::AbstractClientPtr::dynamicCast(Tp::SharedPtr(observer)), "TpSessionChannelObserver"); - - // qDebug() << "TpSession::createObserver" << (registered ? "started" : "failed"); + qDebug() << "TpSession::createObserver" << (registered ? "started" : "failed"); } @@ -212,7 +212,9 @@ void TpSession::createChannelListener(const QString &channelType, const Tp::AccountPtr &account, const Tp::ChannelPtr &channel) { - qDebug() << "TpSession::createChannelListener"; + Q_UNUSED(context); + Q_UNUSED(account); + qDebug() << "TpSession::createChannelListener"; QString channelObjectPath = channel->objectPath(); diff --git a/tpsession-0.1/tpsession/tpsession.pro.user b/tpsession-0.1/tpsession/tpsession.pro.user index bb5e982..009504f 100644 --- a/tpsession-0.1/tpsession/tpsession.pro.user +++ b/tpsession-0.1/tpsession/tpsession.pro.user @@ -1,140 +1,112 @@ - RunConfiguration0-Arguments - + ProjectExplorer.Project.ActiveTarget + 0 - RunConfiguration0-Executable - - - - RunConfiguration0-RunConfiguration.name - Custom Executable - - - RunConfiguration0-WorkingDirectory - $BUILDDIR - - - RunConfiguration0-type - ProjectExplorer.CustomExecutableRunConfiguration - - - activeRunConfiguration - 0 - - - activebuildconfiguration - Debug - - - buildConfiguration-Debug - - Debug - 0 - - /Users/kate/scratchbox/fremantle/tpsession/tpsession-0.1/tpsession + ProjectExplorer.Project.EditorSettings + + System - buildConfiguration-Release - - Release - 0 - + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + debug + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /Users/kate/scratchbox/fremantle/tpsession/tpsession-0.1/tpsession + 2 + 0 + true + + + + + QtProjectManager.QMakeBuildStep + + + + + Qt4ProjectManager.MakeStep + false + + release + + + + 2 + + + Qt4ProjectManager.MakeStep + true + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /mnt/hgfs/scratchbox/fremantle/tpsession/tpsession-0.1/tpsession-build-desktop + 2 + 0 + true + + 2 + + + 2 + + false + + + false + $BUILDDIR + Custom Executable + ProjectExplorer.CustomExecutableRunConfiguration + + 1 - buildconfiguration-Debug-buildstep0 - - Debug - 10 - - - - buildconfiguration-Debug-buildstep1 - - Debug - - debug - - - - - buildconfiguration-Debug-cleanstep0 - - Debug - - - - buildconfiguration-Release-buildstep0 - - Release - 8 - - - - buildconfiguration-Release-buildstep1 - - Release - - release - - - - - buildconfiguration-Release-cleanstep0 - - Release - - - - buildconfigurations - - Debug - Release - - - - buildstep0 - - - - - - - buildstep1 - - - - - - buildsteps - - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make - - - - cleanstep0 - - - true - - - - cleansteps - - trolltech.qt4projectmanager.make - - - - defaultFileEncoding - System + ProjectExplorer.Project.TargetCount + 1 - project - + ProjectExplorer.Project.Updater.FileVersion + 4 diff --git a/tpsession-0.1/tpsession/tpsessionaccount.cpp b/tpsession-0.1/tpsession/tpsessionaccount.cpp index 512ad8b..657e4ba 100644 --- a/tpsession-0.1/tpsession/tpsessionaccount.cpp +++ b/tpsession-0.1/tpsession/tpsessionaccount.cpp @@ -79,7 +79,7 @@ TpSessionAccount::TpSessionAccount(Tp::AccountManagerPtr am,const QString &objec void TpSessionAccount::onReady(Tp::PendingOperation *op) { - + Q_UNUSED(op); acc = mAcc.data(); // qDebug() << "TpSessionAccount::onReady cmName=" << acc->cmName() << "haveConnection=" << // (acc->haveConnection()? ( acc->connection()->isReady() ? "Ready":"notReady"):"no"); @@ -124,7 +124,6 @@ void TpSessionAccount::onContactsConnectionReady(Tp::PendingOperation *op) #endif // qDebug() << "TpSessionAccount::onContactsConnectionReady "<< acc->cmName() ; // RosterItem *item; - bool exists; myContacts=contactsConn->contactManager()->allKnownContacts(); foreach (const Tp::ContactPtr &contact, myContacts) { // qDebug() << "id=" <id() << " alias=" << contact->alias() << " presence=" << contact->presenceStatus() ; @@ -150,9 +149,10 @@ void TpSessionAccount::onContactsConnectionReady(Tp::PendingOperation *op) Tp::ContactPtr TpSessionAccount::getContactFromAddress(QString id) { + Q_UNUSED(id); Tp::ContactPtr p; foreach (const Tp::ContactPtr &contact, myContacts) { - if(contact->id()==reqContact) return p=contact; + if(contact->id()==id) return p=contact; } return p; } @@ -168,7 +168,7 @@ TpSessionChannel* TpSessionAccount::getChannelFromPeerAddress(QString id) { TpSessionChannel* p=NULL; foreach (TpSessionChannel* channel, myChannels) { - if(channel->peerId()==id) return p=channel; + if(channel->peerId()==id) p=channel; } return p; } @@ -176,28 +176,45 @@ TpSessionChannel* TpSessionAccount::getChannelFromPeerAddress(QString id) * Creates new contact with given address. This function is Acynchronous, it sends request to contact manager for contact creation, * * \param address Contact address/id, as example email address, telephone number etc. - */ + * \return true in success + * + * \return emits contactRetrieved(Tp:.contactPtr,bool success,bool requested) +*/ -void TpSessionAccount::makeContactFromAddress(QString address) +bool TpSessionAccount::makeContactFromAddress(QString address) { + if(!contactsConn) return false; // No contacts connection, return fail reqContact=address; // When we get retrieved signal, we check if it is this one Tp::PendingContacts *pc=contactsConn->contactManager()->contactsForIdentifiers(QStringList(address)); connect(pc,SIGNAL(finished(Tp::PendingOperation *)),SLOT(onNewContactRetrieved(Tp::PendingOperation *))); + return true; } void TpSessionAccount::onNewContactRetrieved(Tp::PendingOperation *op) { + Tp::ContactPtr contact; Tp::PendingContacts *pcontacts = qobject_cast(op); QList contacts = pcontacts->contacts(); QString username = pcontacts->identifiers().first(); if (contacts.size() != 1 || !contacts.first()) { qDebug() << "Unable to add contact " <peerId() << "queuing:" << message; channel->sendMessage(message); // We have already channel - emit messageQueued(this); + emit messageQueued(this,true); } else { reqMessage=message; @@ -239,6 +257,8 @@ void TpSessionAccount::addOutgoingChannel(const Tp::ContactPtr &contact) TpSessionChannel* newChannel=new TpSessionChannel(contact->manager()->connection(),contact); connect(newChannel,SIGNAL(messageReceived(const Tp::ReceivedMessage &,TpSessionChannel *)), SLOT(onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *))); + connect(newChannel,SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *)), + SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *))); connect(newChannel,SIGNAL(channelReady(TpSessionChannel *)), SLOT(onOutgoingChannelReady(TpSessionChannel*))); myChannels+=newChannel; @@ -247,26 +267,29 @@ void TpSessionAccount::addOutgoingChannel(const Tp::ContactPtr &contact) void TpSessionAccount::onOutgoingChannelReady(TpSessionChannel *ch) { - // qDebug() << "TpSessionAccoiunt::onOutgoingChannelReady"; + // qDebug() << "TpSessionAccount::onOutgoingChannelReady"; emit channelReady(this); if(!reqMessage.isEmpty()) { + // qDebug() << "TpSessionAccount::onOutgoingChannelReady peer:" << ch->peerId() << "queuing:" << reqMessage; ch->sendMessage(reqMessage); - emit messageQueued(this); + emit messageQueued(this,true); }; reqMessage.clear(); } -void TpSessionAccount::onMessageSent(const Tp::Message &msg,Tp::MessageSendingFlags, const QString &flags) +void TpSessionAccount::onMessageSent(const Tp::Message &msg,Tp::MessageSendingFlags, const QString &flags,TpSessionChannel *ch) { - // qDebug() << "TpSessionAccount::onMessageSent"; + Q_UNUSED(flags); + // qDebug() << "TpSessionAccount::onMessageSent peer:" << ch->peerId() <<"txt:" << msg.text(); emit messageSent(msg,this); }; void TpSessionAccount::onMessageReceived(const Tp::ReceivedMessage &msg,TpSessionChannel *ch) { + Q_UNUSED(ch); // qDebug() << "TpSessionAccount::onMessageReceived " << msg.text(); - emit messageReceived(msg,this); + emit messageReceived(msg,this); }; void TpSessionAccount::onNewChannels(const Tp::ChannelDetailsList &channels) @@ -289,6 +312,8 @@ void TpSessionAccount::onNewChannels(const Tp::ChannelDetailsList &channels) TpSessionChannel* newChannel=new TpSessionChannel( myIngoingTextChannel); connect(newChannel,SIGNAL(messageReceived(const Tp::ReceivedMessage &,TpSessionChannel *)), SLOT(onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *))); + connect(newChannel,SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *)), + SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *))); myChannels+=newChannel; } if (channelType == TELEPATHY_INTERFACE_CHANNEL_TYPE_STREAMED_MEDIA && !requested) { diff --git a/tpsession-0.1/tpsession/tpsessionaccount.h b/tpsession-0.1/tpsession/tpsessionaccount.h index 77ae755..598aab9 100644 --- a/tpsession-0.1/tpsession/tpsessionaccount.h +++ b/tpsession-0.1/tpsession/tpsessionaccount.h @@ -45,7 +45,7 @@ class TpSessionAccount:public QObject Q_OBJECT public: TpSessionAccount(Tp::AccountManagerPtr am,const QString &objectPath); - void makeContactFromAddress(QString address); + bool makeContactFromAddress(QString address); void sendMessageToAddress(QString address,QString message); Tp::ContactPtr getContactFromAddress(QString address); void addOutgoingChannel(const Tp::ContactPtr &contact); @@ -54,10 +54,11 @@ public: signals: void accountReady(TpSessionAccount *); void channelReady(TpSessionAccount *); - void messageQueued(TpSessionAccount *); + void messageQueued(TpSessionAccount *,bool); void messageReceived(const Tp::ReceivedMessage &,TpSessionAccount *); void messageSent(const Tp::Message &,TpSessionAccount *); void newChannel(TpSessionAccount *,QString,QString,const Tp::ChannelDetails &); + void contactRetrieved(Tp::ContactPtr,bool,bool); private slots: void onReady(Tp::PendingOperation *op); @@ -65,7 +66,7 @@ private slots: void onContactsConnectionReady(Tp::PendingOperation *op); void onNewContactRetrieved(Tp::PendingOperation *op); void onMessageReceived(const Tp::ReceivedMessage &,TpSessionChannel *); - void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &); + void onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &,TpSessionChannel *); void onNewChannels(const Tp::ChannelDetailsList&); public: bool ready; diff --git a/tpsession-0.1/tpsession/tpsessionchannel.cpp b/tpsession-0.1/tpsession/tpsessionchannel.cpp index 759289c..96a4972 100644 --- a/tpsession-0.1/tpsession/tpsessionchannel.cpp +++ b/tpsession-0.1/tpsession/tpsessionchannel.cpp @@ -74,7 +74,7 @@ TpSessionChannel::TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr &contact) { QVariantMap request; - // qDebug() << "TpSessionChannel::TpSessionChannel" <<"contact.id() " << contact->id(); + // qDebug() << "TpSessionChannel::TpSessionChannel" <<"contact.id() " << contact->id() << contact->id().toLocal8Bit().toHex(); request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".ChannelType"), TELEPATHY_INTERFACE_CHANNEL_TYPE_TEXT); request.insert(QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandleType"), @@ -124,10 +124,19 @@ void TpSessionChannel::onChannelCreated(Tp::PendingOperation *op) SLOT(onChannelReady(Tp::PendingOperation*))); } +QString TpSessionChannel::objectPath() +{ + return channel->objectPath(); +} +QString TpSessionChannel::type() +{ + return channel->channelType(); +} void TpSessionChannel::onChannelReady(Tp::PendingOperation *op) { - // qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() << - // "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL") ; + Q_UNUSED(op); + //qDebug() << "TpSessionChannel::onChannelReady type=" << channel->channelType() <<"path " << channel->objectPath() << + // "initiatorContact=" << (channel->initiatorContact() ? channel->initiatorContact()->id():"NULL"); ; connect(channel.data(), SIGNAL(messageReceived(const Tp::ReceivedMessage &)), @@ -136,8 +145,8 @@ void TpSessionChannel::onChannelReady(Tp::PendingOperation *op) SIGNAL(messageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &)), SLOT(onMessageSent(const Tp::Message &,Tp::MessageSendingFlags, const QString &))); connect(channel.data(),SIGNAL(destroyed(QObject *)),SLOT(onChannelDestroyed(QObject *))); + if(peerId().isEmpty()) peerContact=channel->initiatorContact(); // If this is incoming channel emit channelReady(this); - peerContact=channel->initiatorContact(); QList queuedMessages = channel->messageQueue(); foreach(Tp::ReceivedMessage message, queuedMessages) { // qDebug() << "received " << message.text(); @@ -162,7 +171,7 @@ void TpSessionChannel::onMessageReceived(const Tp::ReceivedMessage &msg) }; void TpSessionChannel::onMessageSent(const Tp::Message &msg,Tp::MessageSendingFlags sflags, const QString &flags) { - // qDebug() << "TpSessionChannel::onMessageSent"; + // qDebug() << "TpSessionChannel::onMessageSen" << peerId() <<"txt:" << msg.text();; emit messageSent(msg,sflags,flags,this); }; /** @@ -173,12 +182,13 @@ void TpSessionChannel::onMessageSent(const Tp::Message &msg,Tp::MessageSendingFl */ QString TpSessionChannel::peerId() { - return peerContact ? peerContact->id():""; + return peerContact ? peerContact->id():QString(); } void TpSessionChannel::onChannelDestroyed(QObject *obj) { - // qDebug() << "TpSessionChannel::onChannelDestroyed"; + Q_UNUSED(obj); + qDebug() << "TpSessionChannel::onChannelDestroyed"; //TpSessionChannel *call = (TpSessionChannel *) obj; emit channelDestroyed(this); } diff --git a/tpsession-0.1/tpsession/tpsessionchannel.h b/tpsession-0.1/tpsession/tpsessionchannel.h index cf71af0..44db8ea 100644 --- a/tpsession-0.1/tpsession/tpsessionchannel.h +++ b/tpsession-0.1/tpsession/tpsessionchannel.h @@ -41,6 +41,8 @@ public: TpSessionChannel(Tp::ConnectionPtr conn,const Tp::ContactPtr &contact); void sendMessage(QString message); QString peerId(); + QString objectPath(); + QString type(); signals: void channelReady(TpSessionChannel *); void channelDestroyed(TpSessionChannel *);