Commit 0bed27ff authored by Adrien Béraud's avatar Adrien Béraud

Rename DHTAccount to RingAccount

Refs #59537

Change-Id: Id43bd63dc93c08bcab202437957e66cae9e36554
parent 800e545a
......@@ -600,8 +600,8 @@ AC_CONFIG_FILES([Makefile \
src/sip/Makefile \
src/im/Makefile \
src/iax/Makefile \
src/dht/Makefile \
src/dht/dhtcpp/Makefile \
src/ringdht/Makefile \
src/ringdht/dhtcpp/Makefile \
src/audio/Makefile \
src/audio/audiortp/Makefile \
src/audio/pulseaudio/Makefile \
......
......@@ -21,9 +21,9 @@ IAX_LIB=-liax
endif
if USE_DHT
DHT_SUBDIR=dht
DHT_CXXFLAG=-DUSE_DHT
DHT_LIBA=./dht/libdht.la
RINGACC_SUBDIR=ringdht
RINGACC_CXXFLAG=-DUSE_DHT
RINGACC_LIBA=./ringdht/libringacc.la
endif
if USE_NETWORKMANAGER
......@@ -35,7 +35,7 @@ TLS_LIB = @GNUTLS_LIBS@
TLS_CFLAGS = @GNUTLS_CFLAGS@
endif
SUBDIRS = client audio config hooks history sip $(IAX_SUBDIR) $(DHT_SUBDIR) $(INSTANT_MESSAGING_SUBDIR) $(SFL_VIDEO_SUBDIR)
SUBDIRS = client audio config hooks history sip $(IAX_SUBDIR) $(RINGACC_SUBDIR) $(INSTANT_MESSAGING_SUBDIR) $(SFL_VIDEO_SUBDIR)
# libsflphone
......@@ -48,7 +48,7 @@ libsflphone_la_LIBADD = \
./config/libconfig.la \
./hooks/libhooks.la \
./history/libhistory.la \
$(DHT_LIBA) \
$(RINGACC_LIBA) \
$(IAX_LIBA) \
$(IM_LIBA) \
$(SFL_VIDEO_LIBS)
......
......@@ -39,7 +39,7 @@
#include "iax/iaxaccount.h"
#endif
#if HAVE_DHT
#include "dht/dhtaccount.h"
#include "ringdht/ringaccount.h"
#endif
#include "sip/sipvoiplink.h" // for SIPVoIPLink::loadIP2IPSettings
......@@ -59,9 +59,9 @@ AccountFactory::AccountFactory()
SFL_DBG("registered %s account", IAXAccount::ACCOUNT_TYPE);
#endif
#if HAVE_DHT
auto dhtfunc = [](const std::string& id){ return std::make_shared<DHTAccount>(id, false); };
generators_.insert(std::make_pair(DHTAccount::ACCOUNT_TYPE, dhtfunc));
SFL_DBG("registered %s account", DHTAccount::ACCOUNT_TYPE);
auto dhtfunc = [](const std::string& id){ return std::make_shared<RingAccount>(id, false); };
generators_.insert(std::make_pair(RingAccount::ACCOUNT_TYPE, dhtfunc));
SFL_DBG("registered %s account", RingAccount::ACCOUNT_TYPE);
#endif
}
......
......@@ -47,7 +47,7 @@
#include "map_utils.h"
#include "account.h"
#if HAVE_DHT
#include "dht/dhtaccount.h"
#include "ringdht/ringaccount.h"
#endif
#include "call_factory.h"
......@@ -2766,9 +2766,9 @@ ManagerImpl::newOutgoingCall(const std::string& id,
std::string finalToUrl = toUrl;
#if HAVE_DHT
if (toUrl.find("dht:") != std::string::npos) {
SFL_WARN("DHT call detected");
auto dhtAcc = getAllAccounts<DHTAccount>();
if (toUrl.find("ring:") != std::string::npos) {
SFL_WARN("Ring DHT call detected");
auto dhtAcc = getAllAccounts<RingAccount>();
if (not dhtAcc.empty())
return dhtAcc.front()->newOutgoingCall(id, finalToUrl);
}
......
......@@ -2,16 +2,16 @@ include $(top_srcdir)/globals.mak
if USE_DHT
noinst_LTLIBRARIES = libdht.la
libdht_la_CXXFLAGS = @CXXFLAGS@
noinst_LTLIBRARIES = libringacc.la
libringacc_la_CXXFLAGS = @CXXFLAGS@
SUBDIRS = dhtcpp
libdht_la_LIBADD = \
libringacc_la_LIBADD = \
dhtcpp/libdhtcpp.la
libdht_la_SOURCES = \
dhtaccount.cpp \
dhtaccount.h
libringacc_la_SOURCES = \
ringaccount.cpp \
ringaccount.h
endif
......@@ -29,8 +29,8 @@
* as that of the covered work.
*/
#ifndef DHTACCOUNT_H
#define DHTACCOUNT_H
#ifndef RINGACCOUNT_H
#define RINGACCOUNT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
......@@ -68,9 +68,9 @@ namespace YAML {
* @file sipaccount.h
* @brief A SIP Account specify SIP specific functions and object = SIPCall/SIPVoIPLink)
*/
class DHTAccount : public SIPAccountBase {
class RingAccount : public SIPAccountBase {
public:
constexpr static const char * const ACCOUNT_TYPE = "DHT";
constexpr static const char * const ACCOUNT_TYPE = "RING";
constexpr static const in_port_t DHT_DEFAULT_PORT = 4222;
const char* getAccountType() const {
......@@ -81,9 +81,9 @@ class DHTAccount : public SIPAccountBase {
* Constructor
* @param accountID The account identifier
*/
DHTAccount(const std::string& accountID, bool presenceEnabled);
RingAccount(const std::string& accountID, bool presenceEnabled);
~DHTAccount();
~RingAccount();
/**
* Serialize internal state of this account for configuration
......@@ -261,7 +261,7 @@ class DHTAccount : public SIPAccountBase {
*/
virtual void setAccountDetails(const std::map<std::string, std::string> &details);
NON_COPYABLE(DHTAccount);
NON_COPYABLE(RingAccount);
/**
* Start a SIP Call
......
......@@ -45,7 +45,7 @@
#include "string_utils.h"
#if HAVE_DHT
#include "dht/dhtaccount.h"
#include "ringdht/ringaccount.h"
#endif
#include "call_factory.h"
......@@ -654,7 +654,7 @@ SIPVoIPLink::guessAccount(const std::string& userName,
#if HAVE_DHT
// DHT accounts
for (const auto& account : Manager::instance().getAllAccounts<DHTAccount>()) {
for (const auto& account : Manager::instance().getAllAccounts<RingAccount>()) {
if (!account)
continue;
const MatchRank match(account->matches(userName, server));
......
include ../globals.mak
libexecdir=$(libdir)/sflphone
libexecdir=$(libdir)/dht
libexec_PROGRAMS = dhtnode
dhtnode_SOURCES = \
......@@ -8,8 +8,8 @@ dhtnode_SOURCES = \
$(top_srcdir)/src/logger.c \
dhtnode.cpp
dhtnode_CXXFLAGS=-I$(top_srcdir)/src/dht -DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\"
dhtnode_CXXFLAGS=-I$(top_srcdir)/src/ringdht -DTOP_BUILDDIR=\"$$(cd "$(top_builddir)"; pwd)\"
dhtnode_LDFLAGS = @GNUTLS_LIBS@ -lpthread
dhtnode_LDADD = $(top_builddir)/src/dht/dhtcpp/libdhtcpp.la
dhtnode_LDADD = $(top_builddir)/src/ringdht/dhtcpp/libdhtcpp.la
......@@ -366,7 +366,7 @@ gboolean account_is_IAX(const account_t *account)
gboolean account_is_DHT(const account_t *account)
{
return is_type(account, "DHT");
return is_type(account, "RING");
}
account_t *create_default_account()
......
......@@ -172,7 +172,7 @@ static void show_password_cb(G_GNUC_UNUSED GtkWidget *widget, gpointer data)
static void hide_widget_for_dht(GtkComboBox *combo_box, gpointer widget)
{
gchar *type = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo_box));
if (utf8_case_equal(type, "DHT")) {
if (utf8_case_equal(type, "RING")) {
gtk_widget_hide(GTK_WIDGET(widget));
} else {
gtk_widget_show(GTK_WIDGET(widget));
......@@ -184,7 +184,7 @@ static void hide_widget_for_dht(GtkComboBox *combo_box, gpointer widget)
static void show_widget_for_dht(GtkComboBox *combo_box, gpointer widget)
{
gchar *type = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(combo_box));
if (utf8_case_equal(type, "DHT")) {
if (utf8_case_equal(type, "RING")) {
gtk_widget_show(GTK_WIDGET(widget));
} else {
gtk_widget_hide(GTK_WIDGET(widget));
......@@ -218,7 +218,7 @@ static void change_type_cb(GtkComboBox *combo_box, gpointer data)
if (utf8_case_equal(type, "IAX")) {
gtk_widget_hide(security_tab);
gtk_widget_hide(advanced_tab);
} else if (utf8_case_equal(type, "DHT")) {
} else if (utf8_case_equal(type, "RING")) {
gtk_widget_hide(security_tab);
gtk_widget_show(advanced_tab);
} else if (utf8_case_equal(type, "SIP")) {
......@@ -329,7 +329,7 @@ create_accout_type_combo_box(const account_t *account, gboolean is_new)
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "SIP");
if (dbus_is_iax2_enabled())
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "IAX");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "DHT");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(account_combo), "RING");
if (account_is_SIP(account))
gtk_combo_box_set_active(GTK_COMBO_BOX(account_combo), 0);
......@@ -1528,9 +1528,9 @@ static void update_account_from_basic_tab(account_t *account)
else
proto = g_strdup("SIP");
if (g_strcmp0(proto, "SIP") == 0 || g_strcmp0(proto, "DHT") == 0) {
if (g_strcmp0(proto, "SIP") == 0 || g_strcmp0(proto, "RING") == 0) {
if (!IS_IP2IP && g_strcmp0(proto, "DHT") != 0) {
if (!IS_IP2IP && g_strcmp0(proto, "RING") != 0) {
account_replace(account, CONFIG_ACCOUNT_REGISTRATION_EXPIRE,
gtk_entry_get_text(GTK_ENTRY(expire_spin_box)));
......@@ -1560,7 +1560,7 @@ static void update_account_from_basic_tab(account_t *account)
#endif
#ifdef SFL_PRESENCE
if (!IS_IP2IP && g_strcmp0(proto, "DHT") != 0) {
if (!IS_IP2IP && g_strcmp0(proto, "RING") != 0) {
v = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(presence_check_box));
account_replace(account, CONFIG_PRESENCE_ENABLED, bool_to_string(v));
// TODO enable/disable the presence window view
......@@ -1607,7 +1607,7 @@ static void update_account_from_basic_tab(account_t *account)
account_replace(account, CONFIG_ACCOUNT_ALIAS, gtk_entry_get_text(GTK_ENTRY(entry_alias)));
account_replace(account, CONFIG_ACCOUNT_TYPE, proto);
account_replace(account, CONFIG_ACCOUNT_HOSTNAME, gtk_entry_get_text(GTK_ENTRY(entry_hostname)));
if (g_strcmp0(proto, "DHT") != 0) {
if (g_strcmp0(proto, "RING") != 0) {
account_replace(account, CONFIG_ACCOUNT_USERNAME, gtk_entry_get_text(GTK_ENTRY(entry_username)));
account_replace(account, CONFIG_ACCOUNT_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entry_password)));
account_replace(account, CONFIG_ACCOUNT_MAILBOX, gtk_entry_get_text(GTK_ENTRY(entry_mailbox)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment