diff options
Diffstat (limited to 'Swiftob')
-rw-r--r-- | Swiftob/Commands.cpp | 3 | ||||
-rw-r--r-- | Swiftob/Commands.h | 4 | ||||
-rw-r--r-- | Swiftob/LuaCommands.cpp | 6 | ||||
-rw-r--r-- | Swiftob/LuaCommands.h | 9 | ||||
-rw-r--r-- | Swiftob/MUCs.cpp | 8 | ||||
-rw-r--r-- | Swiftob/SConscript | 11 | ||||
-rw-r--r-- | Swiftob/Storage.cpp | 6 | ||||
-rw-r--r-- | Swiftob/Swiftob.cpp | 7 | ||||
-rw-r--r-- | Swiftob/Swiftob.h | 4 | ||||
-rw-r--r-- | Swiftob/Users.cpp | 5 | ||||
-rw-r--r-- | Swiftob/linit.cpp (renamed from Swiftob/linit.c) | 0 | ||||
-rw-r--r-- | Swiftob/main.cpp | 2 |
12 files changed, 32 insertions, 33 deletions
diff --git a/Swiftob/Commands.cpp b/Swiftob/Commands.cpp index e39d23e..cf24196 100644 --- a/Swiftob/Commands.cpp +++ b/Swiftob/Commands.cpp @@ -4,8 +4,9 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/Commands.h" +#include <Swiftob/Commands.h> +#include <Swiften/Base/foreach.h> #include <iostream> #include <boost/bind.hpp> diff --git a/Swiftob/Commands.h b/Swiftob/Commands.h index e11078d..8423252 100644 --- a/Swiftob/Commands.h +++ b/Swiftob/Commands.h @@ -12,8 +12,8 @@ #include <Swiften/Base/boost_bsignals.h> #include <Swiften/Elements/Message.h> -#include "Swiftob/Users.h" -#include "Swiftob/MUCs.h" +#include <Swiftob/Users.h> +#include <Swiftob/MUCs.h> namespace Swift { class Client; diff --git a/Swiftob/LuaCommands.cpp b/Swiftob/LuaCommands.cpp index 7be818e..9f99d82 100644 --- a/Swiftob/LuaCommands.cpp +++ b/Swiftob/LuaCommands.cpp @@ -4,16 +4,18 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/LuaCommands.h" +#include <Swiftob/LuaCommands.h> #include <boost/bind.hpp> #include <vector> #include <algorithm> +#include <iostream> +#include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> #include <Swiften/Network/TimerFactory.h> -#include "Swiftob/Commands.h" +#include <Swiftob/Commands.h> #define LUA_COMMANDS "__Lua_Commands" #define STORAGE "__Storage" diff --git a/Swiftob/LuaCommands.h b/Swiftob/LuaCommands.h index dc8e36e..fc743ca 100644 --- a/Swiftob/LuaCommands.h +++ b/Swiftob/LuaCommands.h @@ -9,21 +9,18 @@ #include <string> #include <vector> -extern "C" { #include <lua.h> #include <lauxlib.h> #include <lualib.h> -} - #include <boost/filesystem/fstream.hpp> #include <boost/noncopyable.hpp> -#include "Swiften/Network/NetworkFactories.h" +#include <Swiften/Network/NetworkFactories.h> #include <Swiften/Elements/SoftwareVersion.h> #include <Swiften/Queries/Requests/GetSoftwareVersionRequest.h> #include <Swiften/Network/Timer.h> -#include "Swiftob/Commands.h" -#include "Swiftob/Storage.h" +#include <Swiftob/Commands.h> +#include <Swiftob/Storage.h> using namespace Swift; /** diff --git a/Swiftob/MUCs.cpp b/Swiftob/MUCs.cpp index 55bf313..695cbd9 100644 --- a/Swiftob/MUCs.cpp +++ b/Swiftob/MUCs.cpp @@ -4,14 +4,18 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/MUCs.h" +#include <Swiftob/MUCs.h> +#include <boost/bind.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> + +#include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> #include <Swiften/MUC/MUC.h> #include <Swiften/MUC/MUCManager.h> #include <Swiften/Base/String.h> -#include "Swiftob/Storage.h" +#include <Swiftob/Storage.h> #define MUC_LIST_SETTING "muc_list" diff --git a/Swiftob/SConscript b/Swiftob/SConscript index 3928ff0..43c4819 100644 --- a/Swiftob/SConscript +++ b/Swiftob/SConscript @@ -4,17 +4,10 @@ Import("env") if env["SCONS_STAGE"] == "build": myenv = env.Clone() myenv.MergeFlags(myenv["SWIFTEN_FLAGS"]) - myenv.MergeFlags(myenv["LIBIDN_FLAGS"]) - myenv.MergeFlags(myenv["BOOST_FLAGS"]) - myenv.MergeFlags(myenv["ZLIB_FLAGS"]) - myenv.MergeFlags(myenv["OPENSSL_FLAGS"]) - myenv.MergeFlags(myenv.get("SQLITE_FLAGS", {})) - myenv.MergeFlags(myenv.get("LIBXML_FLAGS", "")) - myenv.MergeFlags(myenv.get("EXPAT_FLAGS", "")) - myenv.MergeFlags(myenv["PLATFORM_FLAGS"]) + myenv.MergeFlags(myenv["SWIFTEN_DEP_FLAGS"]) myenv.MergeFlags(myenv.get("LUA_FLAGS", {})) sources = [ - "linit.c", # This is horrible! + "linit.cpp", "Swiftob.cpp", "Users.cpp", "Commands.cpp", diff --git a/Swiftob/Storage.cpp b/Swiftob/Storage.cpp index 0cf16d7..47d0619 100644 --- a/Swiftob/Storage.cpp +++ b/Swiftob/Storage.cpp @@ -4,7 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/Storage.h" +#include <Swiftob/Storage.h> #include <Swiften/Base/String.h> #include <Swiften/Base/ByteArray.h> @@ -23,8 +23,8 @@ Storage::Storage(const boost::filesystem::path& path) : settingsPath_(path) { void Storage::load() { if (boost::filesystem::exists(settingsPath_)) { Swift::ByteArray data; - data.readFromFile(settingsPath_.string()); - foreach (std::string line, Swift::String::split(data.toString(), '\n')) { + Swift::readByteArrayFromFile(data, settingsPath_.string()); + foreach (std::string line, Swift::String::split(Swift::byteArrayToString(data), '\n')) { std::pair<std::string, std::string> pair = Swift::String::getSplittedAtFirst(line, '\t'); settings_[pair.first] = pair.second; } diff --git a/Swiftob/Swiftob.cpp b/Swiftob/Swiftob.cpp index 6c6dad0..331e55e 100644 --- a/Swiftob/Swiftob.cpp +++ b/Swiftob/Swiftob.cpp @@ -4,7 +4,7 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/Swiftob.h" +#include <Swiftob/Swiftob.h> #include <string> #include <iostream> @@ -14,8 +14,8 @@ #include <Swiften/Base/String.h> #include <Swiften/Presence/PresenceSender.h> -#include "Swiftob/Users.h" -#include "Swiftob/Storage.h" +#include <Swiftob/Users.h> +#include <Swiftob/Storage.h> po::options_description Swiftob::getOptionsDescription() { @@ -108,6 +108,7 @@ Swiftob::~Swiftob() { delete commands_; delete storage_; delete users_; + delete mucs_; delete client_; } diff --git a/Swiftob/Swiftob.h b/Swiftob/Swiftob.h index 45061d0..ad4e9b8 100644 --- a/Swiftob/Swiftob.h +++ b/Swiftob/Swiftob.h @@ -18,8 +18,8 @@ #include <Swiften/Client/Client.h> #include <Swiften/Network/BoostNetworkFactories.h> -#include "Swiftob/Commands.h" -#include "Swiftob/LuaCommands.h" +#include <Swiftob/Commands.h> +#include <Swiftob/LuaCommands.h> namespace po = boost::program_options; diff --git a/Swiftob/Users.cpp b/Swiftob/Users.cpp index 55ba4eb..09173cc 100644 --- a/Swiftob/Users.cpp +++ b/Swiftob/Users.cpp @@ -4,13 +4,14 @@ * See Documentation/Licenses/GPLv3.txt for more information. */ -#include "Swiftob/Users.h" +#include <Swiftob/Users.h> #include <iostream> +#include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> -#include "Swiftob/MUCs.h" +#include <Swiftob/MUCs.h> Users::Users(Client* client, MUCs* mucs) { client_ = client; diff --git a/Swiftob/linit.c b/Swiftob/linit.cpp index 13c5b09..13c5b09 100644 --- a/Swiftob/linit.c +++ b/Swiftob/linit.cpp diff --git a/Swiftob/main.cpp b/Swiftob/main.cpp index 9908b45..a4e0925 100644 --- a/Swiftob/main.cpp +++ b/Swiftob/main.cpp @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) { boost::program_options::variables_map vm; try { boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm); - } catch (boost::program_options::unknown_option option) { + } catch (const boost::program_options::unknown_option& option) { #if BOOST_VERSION >= 104200 std::cout << "Ignoring unknown option " << option.get_option_name() << " but continuing." << std::endl; #else |