summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-18 02:31:18 +0100
committerlouiz’ <louiz@louiz.org>2018-03-18 02:31:18 +0100
commit577984faf2befaa7f11a1e4a115dc8d80805fec7 (patch)
treedb65417e4dc37123841309f9c9ee8d375bf9e003 /src/database/database.hpp
parentad7aa5b7090f093a8a167a3fcb29c421881946f7 (diff)
downloadbiboumi-577984faf2befaa7f11a1e4a115dc8d80805fec7.tar.gz
biboumi-577984faf2befaa7f11a1e4a115dc8d80805fec7.tar.bz2
biboumi-577984faf2befaa7f11a1e4a115dc8d80805fec7.tar.xz
biboumi-577984faf2befaa7f11a1e4a115dc8d80805fec7.zip
Allow the execution of multiple commands after the IRC connection
fix #3275
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 8a967d8..0e88be8 100644
--- a/src/database/database.hpp
+++ b/src/database/database.hpp
@@ -92,7 +92,7 @@ class Database
using GlobalOptionsTable = Table<Id, Owner, MaxHistoryLength, RecordHistory, GlobalPersistent>;
using GlobalOptions = GlobalOptionsTable::RowType;
- using IrcServerOptionsTable = Table<Id, Owner, Server, Pass, AfterConnectionCommand, TlsPorts, Ports, Username, Realname, VerifyCert, TrustedFingerprint, EncodingOut, EncodingIn, MaxHistoryLength, Address>;
+ using IrcServerOptionsTable = Table<Id, Owner, Server, Pass, TlsPorts, Ports, Username, Realname, VerifyCert, TrustedFingerprint, EncodingOut, EncodingIn, MaxHistoryLength, Address>;
using IrcServerOptions = IrcServerOptionsTable::RowType;
using IrcChannelOptionsTable = Table<Id, Owner, Server, Channel, EncodingOut, EncodingIn, MaxHistoryLength, Persistent, RecordHistoryOptional>;
@@ -101,6 +101,9 @@ class Database
using RosterTable = Table<LocalJid, RemoteJid>;
using RosterItem = RosterTable::RowType;
+ using AfterConnectionCommandsTable = Table<Id, ForeignKey, AfterConnectionCommand>;
+ using AfterConnectionCommands = std::vector<AfterConnectionCommandsTable::RowType>;
+
Database() = default;
~Database() = default;
@@ -121,6 +124,9 @@ class Database
static IrcChannelOptions get_irc_channel_options_with_server_and_global_default(const std::string& owner,
const std::string& server,
const std::string& channel);
+ static AfterConnectionCommands get_after_connection_commands(const IrcServerOptions& server_options);
+ static void set_after_connection_commands(const IrcServerOptions& server_options, AfterConnectionCommands& commands);
+
/**
* Get all the lines between (optional) start and end dates, with a (optional) limit.
* If after_id is set, only the records after it will be returned.
@@ -158,6 +164,8 @@ class Database
static IrcServerOptionsTable irc_server_options;
static IrcChannelOptionsTable irc_channel_options;
static RosterTable roster;
+ static AfterConnectionCommandsTable after_connection_commands;
+
static std::unique_ptr<DatabaseEngine> db;
/**