Attachment 'coding_test.patch'

Download

   1 From 440b90d2bc752a39d654d22a1bd63f5327213692 Mon Sep 17 00:00:00 2001
   2 From: mateus <mateus@mateus.mateus>
   3 Date: Tue, 5 Apr 2016 14:52:36 -0300
   4 Subject: [PATCH] code test GSoC 2016
   5 
   6 ---
   7  apps/telepathy/Connection.cxx            | 16 +++++++++++-----
   8  apps/telepathy/Connection.hxx            | 24 ++++++++++++------------
   9  apps/telepathy/MyConversationManager.hxx |  3 ++-
  10  3 files changed, 25 insertions(+), 18 deletions(-)
  11 
  12 diff --git a/apps/telepathy/Connection.cxx b/apps/telepathy/Connection.cxx
  13 index 43b57f4..83352ed 100644
  14 --- a/apps/telepathy/Connection.cxx
  15 +++ b/apps/telepathy/Connection.cxx
  16 @@ -271,7 +271,12 @@ tr::Connection::requestHandles(uint handleType, const QStringList &identifiers,
  17     return result;
  18  }
  19  
  20 -Tp::BaseChannelPtr
  21 +
  22 +void destroyChannel(recon::ConversationHandle cHandle, Tp::DBusError *error){
  23 +  myConversationManager->destroyConversation(cHandle);
  24 +}
  25 +
  26 +recon::ConversationHandle
  27  tr::Connection::createChannel(const QVariantMap &request, Tp::DBusError *error)
  28  {
  29     StackLog(<<"createChannel");
  30 @@ -316,9 +321,9 @@ tr::Connection::createChannel(const QVariantMap &request, Tp::DBusError *error)
  31     bool incoming = false;
  32     StackLog(<<"createChannel - channelType = " << channelType.toUtf8().constData() << " and contact = " << targetID.toUtf8().constData());
  33     if(channelType == TP_QT_IFACE_CHANNEL_TYPE_CALL) {
  34 -      recon::ConversationHandle cHandle = 1;   // FIXME - hardcoded default value, should create new Conversation
  35 -      //recon::ConversationHandle cHandle = myConversationManager->createConversation();
  36 -      //myConversationManager->createLocalParticipant();
  37 +     //      recon::ConversationHandle cHandle = 1;   // FIXME - hardcoded default value, should create new Conversation
  38 +      recon::ConversationHandle cHandle = myConversationManager->createConversation();
  39 +      recon::ParticipantHandle reconLParticipantHandle = myConversationManager->createLocalParticipant();
  40        if(!request.contains("participantHandle"))
  41        {
  42           // Outgoing call
  43 @@ -340,7 +345,8 @@ tr::Connection::createChannel(const QVariantMap &request, Tp::DBusError *error)
  44  
  45     SipCallChannel *channel = new SipCallChannel(incoming, this, targetID, targetHandle, participantHandle);
  46     channel->baseChannel()->setInitiatorHandle(initiatorHandle);
  47 -   return channel->baseChannel();
  48 +   //   return channel->baseChannel();
  49 +   return cHandle;
  50  }
  51  
  52  Tp::ContactAttributesMap
  53 diff --git a/apps/telepathy/Connection.hxx b/apps/telepathy/Connection.hxx
  54 index 9de94ad..7efe2cd 100644
  55 --- a/apps/telepathy/Connection.hxx
  56 +++ b/apps/telepathy/Connection.hxx
  57 @@ -19,7 +19,7 @@
  58  #define CONNECTION_HXX
  59  
  60  #if defined(HAVE_CONFIG_H)
  61 -  #include "config.h"
  62 +#include "config.h"
  63  #endif
  64  
  65  
  66 @@ -46,19 +46,19 @@ class Connection : public Tp::BaseConnection
  67  {
  68     Q_OBJECT
  69  public:
  70 -   Connection(const QDBusConnection &dbusConnection,
  71 -            const QString &cmName, const QString &protocolName,
  72 -            const QVariantMap &parameters);
  73 -
  74 -   MyConversationManager& getConversationManager() { return *myConversationManager.get(); };
  75 +  Connection(const QDBusConnection &dbusConnection,
  76 +	     const QString &cmName, const QString &protocolName,
  77 +	     const QVariantMap &parameters);
  78 +  
  79 +  MyConversationManager& getConversationManager() { return *myConversationManager.get(); };
  80  
  81  private:
  82 -   uint setPresence(const QString &status, const QString &message, Tp::DBusError *error);
  83 -       QStringList inspectHandles(uint handleType, const Tp::UIntList &handles, Tp::DBusError *error);
  84 -   Tp::UIntList requestHandles(uint handleType, const QStringList &identifiers, Tp::DBusError *error);
  85 -   Tp::BaseChannelPtr createChannel(const QVariantMap &request, Tp::DBusError *error);
  86 -   Tp::ContactAttributesMap getContactAttributes(const Tp::UIntList &handles, const QStringList &ifaces, Tp::DBusError *error);
  87 -   uint ensureHandle(const QString& identifier);
  88 +  uint setPresence(const QString &status, const QString &message, Tp::DBusError *error);
  89 +  QStringList inspectHandles(uint handleType, const Tp::UIntList &handles, Tp::DBusError *error);
  90 +  Tp::UIntList requestHandles(uint handleType, const QStringList &identifiers, Tp::DBusError *error);
  91 +  recon::ConversationHandle createChannel(const QVariantMap &request, Tp::DBusError *error);
  92 +  Tp::ContactAttributesMap getContactAttributes(const Tp::UIntList &handles, const QStringList &ifaces, Tp::DBusError *error);
  93 +  uint ensureHandle(const QString& identifier);
  94  
  95  
  96  private slots:
  97 diff --git a/apps/telepathy/MyConversationManager.hxx b/apps/telepathy/MyConversationManager.hxx
  98 index 4481e57..40a21bf 100644
  99 --- a/apps/telepathy/MyConversationManager.hxx
 100 +++ b/apps/telepathy/MyConversationManager.hxx
 101 @@ -46,7 +46,8 @@ public:
 102     virtual ~MyConversationManager() {};
 103  
 104     virtual void startup();
 105 -   
 106 +
 107 +   virtual void destroyConversation(ConversationHandle convHandle); 
 108     virtual recon::ConversationHandle createConversation();
 109     virtual recon::ParticipantHandle createRemoteParticipant(recon::ConversationHandle convHandle, resip::NameAddr& destination, recon::ConversationManager::ParticipantForkSelectMode forkSelectMode = recon::ConversationManager::ForkSelectAutomatic);
 110     virtual recon::ParticipantHandle createMediaResourceParticipant(recon::ConversationHandle convHandle, const resip::Uri& mediaUrl);
 111 -- 
 112 2.1.4

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2016-04-15 15:46:47, 5.2 KB) [[attachment:coding test]]
  • [get | view] (2016-04-16 00:21:20, 5.2 KB) [[attachment:coding_test.patch]]
  • [get | view] (2016-08-23 16:12:35, 9.8 KB) [[attachment:status_Away.png]]
  • [get | view] (2016-08-23 16:12:44, 9.8 KB) [[attachment:status_Busy (DND).png]]
  • [get | view] (2016-08-23 16:12:53, 9.8 KB) [[attachment:status_In a meeting.png]]
  • [get | view] (2016-08-23 16:13:07, 9.9 KB) [[attachment:status_Offline.png]]
  • [get | view] (2016-08-23 16:13:16, 10.2 KB) [[attachment:status_Online.png]]
  • [get | view] (2016-08-23 16:13:26, 9.9 KB) [[attachment:status_Unknown.png]]
  • [get | view] (2016-08-23 16:12:00, 38.8 KB) [[attachment:textChannel_Empathy.png]]
  • [get | view] (2016-08-23 16:11:34, 51.4 KB) [[attachment:textChannel_Jitsi.png]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.