summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-02-25 19:05:04 +0100
committerFlorent Le Coz <louiz@louiz.org>2015-02-25 19:05:04 +0100
commitc307df85c8e7d9bcd4570269bf13c3e92c3f5954 (patch)
tree6cc8f61506b70383c1426cb617d220096929d1d1 /src
parent2df0ebf2dfed1dcbf80c92bff8361e2a04581bec (diff)
downloadbiboumi-c307df85c8e7d9bcd4570269bf13c3e92c3f5954.tar.gz
biboumi-c307df85c8e7d9bcd4570269bf13c3e92c3f5954.tar.bz2
biboumi-c307df85c8e7d9bcd4570269bf13c3e92c3f5954.tar.xz
biboumi-c307df85c8e7d9bcd4570269bf13c3e92c3f5954.zip
Do not handle the "%" char in a special way, in the fixed_server mode
Also fix some doc
Diffstat (limited to 'src')
-rw-r--r--src/irc/iid.cpp5
-rw-r--r--src/test.cpp10
-rw-r--r--src/utils/empty_if_fixed_server.cpp8
3 files changed, 6 insertions, 17 deletions
diff --git a/src/irc/iid.cpp b/src/irc/iid.cpp
index d4dc8ce..9d39129 100644
--- a/src/irc/iid.cpp
+++ b/src/irc/iid.cpp
@@ -35,7 +35,7 @@ void Iid::init_with_fixed_server(const std::string& iid, const std::string& host
{
this->set_server(hostname);
- const std::string::size_type sep = iid.find_first_of("%!");
+ const std::string::size_type sep = iid.find("!");
// Without any separator, we consider that it's a channel
if (sep == std::string::npos)
@@ -47,9 +47,6 @@ void Iid::init_with_fixed_server(const std::string& iid, const std::string& host
// but the part behind it (the hostname) is ignored
{
this->set_local(iid.substr(0, sep));
- if (iid[sep] == '%')
- this->is_channel = true;
- else
this->is_user = true;
}
}
diff --git a/src/test.cpp b/src/test.cpp
index 9fa2c99..553140f 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -369,13 +369,13 @@ int main()
Iid iid2("#test%irc.example.org");
std::cout << std::to_string(iid2) << std::endl;
- assert(std::to_string(iid2) == "#test");
- assert(iid2.get_local() == "#test");
+ assert(std::to_string(iid2) == "#test%irc.example.org");
+ assert(iid2.get_local() == "#test%irc.example.org");
assert(iid2.get_server() == "fixed.example.com");
assert(iid2.is_channel);
assert(!iid2.is_user);
- // Note that it is impossible to adress the XMPP server directly, or to
+ // Note that it is impossible to adress the IRC server directly, or to
// use the virtual channel, in that mode
// Iid iid3("%irc.example.org");
@@ -391,8 +391,8 @@ int main()
Iid iid6("##channel%");
std::cout << std::to_string(iid6) << std::endl;
- assert(std::to_string(iid6) == "##channel");
- assert(iid6.get_local() == "##channel");
+ assert(std::to_string(iid6) == "##channel%");
+ assert(iid6.get_local() == "##channel%");
assert(iid6.get_server() == "fixed.example.com");
assert(iid6.is_channel);
assert(!iid6.is_user);
diff --git a/src/utils/empty_if_fixed_server.cpp b/src/utils/empty_if_fixed_server.cpp
deleted file mode 100644
index 85fd86d..0000000
--- a/src/utils/empty_if_fixed_server.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// #include <utils/empty_if_fixed_server.hpp>
-
-// #include <config/config.hpp>
-
-// namespace utils
-// {
-// inline std::string empty_if_fixed_server(std::string&& str)
-// }