diff options
author | louiz’ <louiz@louiz.org> | 2017-07-06 22:24:42 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-07-06 22:24:42 +0200 |
commit | 9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c (patch) | |
tree | ba8c243c8633cb236bef629071a2a1264c459101 /src/bridge | |
parent | b71ca15a0f9114db38eec23b49d1489a2ff1d0ca (diff) | |
download | biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.gz biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.bz2 biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.xz biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.zip |
Add a global “persistent” option
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 23ecfe9..81ca147 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -436,9 +436,14 @@ void Bridge::leave_irc_channel(Iid&& iid, const std::string& status_message, con // acknowledgment from the server bool persistent = false; #ifdef USE_DATABASE - const auto coptions = Database::get_irc_channel_options_with_server_default(this->user_jid, - iid.get_server(), iid.get_local()); - persistent = coptions.col<Database::Persistent>(); + const auto goptions = Database::get_global_options(this->user_jid); + if (goptions.col<Database::Persistent>()) + persistent = true; + else + { + const auto coptions = Database::get_irc_channel_options_with_server_default(this->user_jid, iid.get_server(), iid.get_local()); + persistent = coptions.col<Database::Persistent>(); + } #endif if (channel->joined && !channel->parting && !persistent) { |