ekiga r6507 - in trunk: . src/endpoints



Author: jpuydt
Date: Fri Jul 25 12:35:22 2008
New Revision: 6507
URL: http://svn.gnome.org/viewvc/ekiga?rev=6507&view=rev

Log:
Enable "Call" or "Forward" depending on whether we're in a call or not

Modified:
   trunk/ChangeLog
   trunk/src/endpoints/sip.cpp
   trunk/src/endpoints/sip.h

Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp	(original)
+++ trunk/src/endpoints/sip.cpp	Fri Jul 25 12:35:22 2008
@@ -198,16 +198,26 @@
        iter++) {
 
     std::string call_action = _("Call");
+    std::string forward_action = _("Forward");
     std::string msg_action = _("Message");
 
     if (!iter->first.empty ()) {
 
       call_action = call_action + " [" + iter->first + "]";
+      forward_action = forward_action + " [" + iter->first + "]";
       msg_action = msg_action + " [" + iter->first + "]";
     }
 
-    builder.add_action ("call", call_action,
-			sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_dial), iter->second));
+    if (0 == GetConnectionCount ()) {
+
+      builder.add_action ("call", call_action,
+			  sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_dial), iter->second));
+    } else {
+
+      builder.add_action ("forward", forward_action,
+			  sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_forward), iter->second));
+    }
+
     builder.add_action ("message", msg_action,
 			sigc::bind (sigc::mem_fun (this, &CallProtocolManager::on_message), iter->second, fullname));
 
@@ -987,3 +997,12 @@
 {
   dialect->start_chat_with (uri, name);
 }
+
+void CallProtocolManager::on_forward (std::string uri)
+{
+  PStringList connections = GetAllConnections ();
+  /* FIXME : we don't handle several connections here */
+  PSafePtr<OpalConnection> connection = GetConnectionWithLock (connections[0]);
+
+  connection->ForwardCall (uri);
+}

Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h	(original)
+++ trunk/src/endpoints/sip.h	Fri Jul 25 12:35:22 2008
@@ -165,6 +165,7 @@
       void on_dial (std::string uri);
       void on_message (std::string uri,
 		       std::string name);
+      void on_forward (std::string uri);
 
       PMutex msgDataMutex;
       msgDict msgData;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]