summaryrefslogtreecommitdiff
path: root/src/irc/iid.cpp
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-06-24 09:21:37 +0200
committerJonas Smedegaard <dr@jones.dk>2017-06-24 09:21:37 +0200
commit3d39f109ba8ea7ae9778c58bd1665b9e8e0f45cb (patch)
tree9a5684babcd16d302fbe59c56b6045660ad62488 /src/irc/iid.cpp
parentf9cee98aacd6aea8ccb7f5677b4ff1e1e234e4d1 (diff)
parentc21cbbf9667991d2b928562a9c199e625d3f9bba (diff)
downloadbiboumi-3d39f109ba8ea7ae9778c58bd1665b9e8e0f45cb.tar.gz
biboumi-3d39f109ba8ea7ae9778c58bd1665b9e8e0f45cb.tar.bz2
biboumi-3d39f109ba8ea7ae9778c58bd1665b9e8e0f45cb.tar.xz
biboumi-3d39f109ba8ea7ae9778c58bd1665b9e8e0f45cb.zip
Updated version 5.0 from 'upstream/5.0'
with Debian dir 2ae31d03ffb1d79153a692af23c7b2b097cc4b2b
Diffstat (limited to 'src/irc/iid.cpp')
-rw-r--r--src/irc/iid.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/irc/iid.cpp b/src/irc/iid.cpp
index d442013..a63a1c3 100644
--- a/src/irc/iid.cpp
+++ b/src/irc/iid.cpp
@@ -1,3 +1,4 @@
+#include <utility>
#include <utils/tolower.hpp>
#include <config/config.hpp>
#include <bridge/bridge.hpp>
@@ -7,10 +8,10 @@
constexpr char Iid::separator[];
-Iid::Iid(const std::string& local, const std::string& server, Iid::Type type):
+Iid::Iid(std::string local, std::string server, Iid::Type type):
type(type),
- local(local),
- server(server)
+ local(std::move(local)),
+ server(std::move(server))
{
}
@@ -34,9 +35,10 @@ Iid::Iid(const std::string& iid, const Bridge *bridge)
void Iid::set_type(const std::set<char>& chantypes)
{
+ if (this->local.empty() && this->server.empty())
+ this->type = Iid::Type::None;
if (this->local.empty())
return;
-
if (chantypes.count(this->local[0]) == 1)
this->type = Iid::Type::Channel;
else
@@ -105,6 +107,8 @@ namespace std {
{
if (iid.type == Iid::Type::Server)
return iid.get_server();
+ else if (iid.get_local().empty() && iid.get_server().empty())
+ return {};
else
return iid.get_encoded_local() + iid.separator + iid.get_server();
}