Commit a8cfbf96 authored by Tristan Matthews's avatar Tristan Matthews

account: move split_string into Account

parent 6a3f6c4a
......@@ -211,6 +211,22 @@ std::string join_string(const std::vector<std::string> &v)
}
}
std::vector<std::string>
Account::split_string(std::string s)
{
std::vector<std::string> list;
std::string temp;
while (s.find("/", 0) != std::string::npos) {
size_t pos = s.find("/", 0);
temp = s.substr(0, pos);
s.erase(0, pos + 1);
list.push_back(temp);
}
return list;
}
void Account::setActiveAudioCodecs(const vector<string> &list)
{
......
......@@ -189,6 +189,9 @@ class Account : public Serializable {
mailBox_ = mb;
}
static std::vector<std::string>
split_string(std::string s);
static const char * const VIDEO_CODEC_ENABLED;
static const char * const VIDEO_CODEC_NAME;
static const char * const VIDEO_CODEC_PARAMETERS;
......
......@@ -95,7 +95,7 @@ void IAXAccount::unserialize(const Conf::YamlNode &map)
map.getValue(AUDIO_CODECS_KEY, &audioCodecStr_);
// Update codec list which one is used for SDP offer
setActiveAudioCodecs(ManagerImpl::split_string(audioCodecStr_));
setActiveAudioCodecs(split_string(audioCodecStr_));
map.getValue(DISPLAY_NAME_KEY, &displayName_);
}
......
......@@ -1897,21 +1897,6 @@ std::string ManagerImpl::createConfigFile() const
return configdir + DIR_SEPARATOR_STR + PROGNAME + ".yml";
}
std::vector<std::string> ManagerImpl::split_string(std::string s)
{
std::vector<std::string> list;
std::string temp;
while (s.find("/", 0) != std::string::npos) {
size_t pos = s.find("/", 0);
temp = s.substr(0, pos);
s.erase(0, pos + 1);
list.push_back(temp);
}
return list;
}
std::string ManagerImpl::getCurrentAudioCodecName(const std::string& id)
{
std::string accountid = getAccountFromCall(id);
......@@ -2538,7 +2523,7 @@ std::string ManagerImpl::getNewCallID()
std::vector<std::string> ManagerImpl::loadAccountOrder() const
{
return split_string(preferences.getAccountOrder());
return Account::split_string(preferences.getAccountOrder());
}
namespace {
......
......@@ -577,8 +577,6 @@ class ManagerImpl {
*/
void setEchoCancelState(const std::string &state);
static std::vector<std::string> split_string(std::string v);
/**
* Ringtone option.
* If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone.
......
......@@ -318,7 +318,7 @@ void SIPAccount::unserialize(const Conf::YamlNode &mapNode)
if (not isIP2IP()) mapNode.getValue(MAILBOX_KEY, &mailBox_);
mapNode.getValue(AUDIO_CODECS_KEY, &audioCodecStr_);
// Update codec list which one is used for SDP offer
setActiveAudioCodecs(ManagerImpl::split_string(audioCodecStr_));
setActiveAudioCodecs(split_string(audioCodecStr_));
#ifdef SFL_VIDEO
YamlNode *videoCodecsNode(mapNode.getValue(VIDEO_CODECS_KEY));
......
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