diff options
author | louiz’ <louiz@louiz.org> | 2017-08-26 13:51:15 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-08-26 13:51:15 +0200 |
commit | 655151d88a6ab948949b73682c3a76a0274eb10c (patch) | |
tree | a6c00cbb46c6b142e82bd860914af1d62587b650 /src/bridge | |
parent | 1997fb5c6a5f791960575a31bd34dfd24cf96a26 (diff) | |
download | biboumi-655151d88a6ab948949b73682c3a76a0274eb10c.tar.gz biboumi-655151d88a6ab948949b73682c3a76a0274eb10c.tar.bz2 biboumi-655151d88a6ab948949b73682c3a76a0274eb10c.tar.xz biboumi-655151d88a6ab948949b73682c3a76a0274eb10c.zip |
Cache the encoding_in database value, to avoid doing a query for each message
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index e0cb36d..9fd0a5b 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -22,15 +22,12 @@ 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()); - auto result = options.col<Database::EncodingIn>(); - if (!result.empty()) - return result; + return Database::get_encoding_in(jid, iid.get_server(), iid.get_local()); #else (void)bridge; (void)iid; -#endif return {"ISO-8859-1"}; +#endif } Bridge::Bridge(std::string user_jid, BiboumiComponent& xmpp, std::shared_ptr<Poller>& poller): |