ekiga r6298 - in trunk: . src/endpoints
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6298 - in trunk: . src/endpoints
- Date: Wed, 21 May 2008 20:47:49 +0000 (UTC)
Author: dsandras
Date: Wed May 21 20:47:49 2008
New Revision: 6298
URL: http://svn.gnome.org/viewvc/ekiga?rev=6298&view=rev
Log:
Turned the GMSIPEndPoint into an implementation of a ChatManager.
Modified:
trunk/ChangeLog
trunk/src/endpoints/opal-main.cpp
trunk/src/endpoints/sip.cpp
trunk/src/endpoints/sip.h
Modified: trunk/src/endpoints/opal-main.cpp
==============================================================================
--- trunk/src/endpoints/opal-main.cpp (original)
+++ trunk/src/endpoints/opal-main.cpp Wed May 21 20:47:49 2008
@@ -39,6 +39,7 @@
#include "contact-core.h"
#include "presence-core.h"
#include "call-core.h"
+#include "chat-core.h"
#include "opal-gmconf-bridge.h"
#include "manager.h"
@@ -63,10 +64,12 @@
Ekiga::ContactCore *contact_core = NULL;
Ekiga::PresenceCore *presence_core = NULL;
Ekiga::CallCore *call_core = NULL;
+ Ekiga::ChatCore *chat_core = NULL;
contact_core = dynamic_cast<Ekiga::ContactCore *> (core.get ("contact-core"));
presence_core = dynamic_cast<Ekiga::PresenceCore *> (core.get ("presence-core"));
call_core = dynamic_cast<Ekiga::CallCore *> (core.get ("call-core"));
+ chat_core = dynamic_cast<Ekiga::ChatCore *> (core.get ("chat-core"));
GMManager *manager = new GMManager (core);
GMSIPEndpoint *sipEP = new GMSIPEndpoint (*manager, core);
@@ -76,6 +79,8 @@
call_core->add_manager (*manager);
core.add (*manager); // FIXME temporary
+ chat_core->add_manager (*sipEP);
+
new Opal::ConfBridge (*manager);
// FIXME Service ?
Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp (original)
+++ trunk/src/endpoints/sip.cpp Wed May 21 20:47:49 2008
@@ -248,6 +248,19 @@
}
+bool GMSIPEndpoint::send_message (const std::string & _uri,
+ const std::string & _message)
+{
+ if (!_uri.empty () && (_uri.find ("sip:") == 0 || _uri.find (':') == string::npos) && !_message.empty ()) {
+
+ Message (_uri.c_str (), _message.c_str ());
+ return true;
+ }
+
+ return false;
+}
+
+
bool GMSIPEndpoint::dial (const std::string & uri)
{
PString token;
@@ -269,19 +282,6 @@
}
-bool GMSIPEndpoint::send_message (const std::string & _uri,
- const std::string & _message)
-{
- if (!_uri.empty () && (_uri.find ("sip:") == 0 || _uri.find (':') == string::npos) && !_message.empty ()) {
-
- Message (_uri.c_str (), _message.c_str ());
- return true;
- }
-
- return false;
-}
-
-
const std::string & GMSIPEndpoint::get_protocol_name () const
{
return protocol_name;
@@ -943,8 +943,8 @@
}
-void GMSIPEndpoint::on_message (std::string name,
- std::string uri)
+void GMSIPEndpoint::on_message (const std::string & name,
+ const std::string & uri)
{
runtime.run_in_main (sigc::bind (new_chat.make_slot (), name, uri));
}
Modified: trunk/src/endpoints/sip.h
==============================================================================
--- trunk/src/endpoints/sip.h (original)
+++ trunk/src/endpoints/sip.h Wed May 21 20:47:49 2008
@@ -46,6 +46,7 @@
#include "manager.h"
#include "presence-core.h"
+#include "chat-manager.h"
#include "call-manager.h"
#include "call-protocol-manager.h"
@@ -56,6 +57,7 @@
class GMSIPEndpoint
: public SIPEndPoint,
+ public Ekiga::ChatManager,
public Ekiga::CallProtocolManager,
public Ekiga::PresenceFetcher,
public Ekiga::PresencePublisher,
@@ -68,10 +70,6 @@
GMSIPEndpoint (GMManager &ep, Ekiga::ServiceCore & core);
- /**/
- bool message (const std::string & uri,
- const std::string & message);
-
/***/
bool populate_menu (Ekiga::Contact &contact,
Ekiga::MenuBuilder &builder);
@@ -88,12 +86,16 @@
void unfetch (const std::string uri);
void publish (const Ekiga::PersonalDetails & details);
- /* ProtocolManager */
- bool dial (const std::string & uri);
+
+ /* ChatManager */
bool send_message (const std::string & uri,
const std::string & message);
+ /* ProtocolManager */
+ bool dial (const std::string & uri);
+
+
const std::string & get_protocol_name () const;
void set_dtmf_mode (unsigned mode);
@@ -153,8 +155,8 @@
private:
void on_dial (std::string uri);
- void on_message (std::string name,
- std::string uri);
+ void on_message (const std::string & name,
+ const std::string & uri);
PMutex msgDataMutex;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]