summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-06-13 11:18:05 +0200
committerlouiz’ <louiz@louiz.org>2017-06-14 00:19:15 +0200
commit369ccb037619871403b14c959bbb359332133810 (patch)
tree559d64437c302c306aade66486fac33ef6320d2a /src/bridge
parent50cadf3dac0d56ef8181d1800cc30f8dcb749141 (diff)
downloadbiboumi-369ccb037619871403b14c959bbb359332133810.tar.gz
biboumi-369ccb037619871403b14c959bbb359332133810.tar.bz2
biboumi-369ccb037619871403b14c959bbb359332133810.tar.xz
biboumi-369ccb037619871403b14c959bbb359332133810.zip
Add default values for the database columns
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index fcfcc24..23ecfe9 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -23,12 +23,14 @@ static std::string in_encoding_for(const Bridge& bridge, const Iid& iid)
#ifdef USE_DATABASE
const auto jid = bridge.get_bare_jid();
auto options = Database::get_irc_channel_options_with_server_default(jid, iid.get_server(), iid.get_local());
- return options.col<Database::EncodingIn>();
+ auto result = options.col<Database::EncodingIn>();
+ if (!result.empty())
+ return result;
#else
(void)bridge;
(void)iid;
- return {"ISO-8859-1"};
#endif
+ return {"ISO-8859-1"};
}
Bridge::Bridge(std::string user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller>& poller):