Files
@ 2add374fbd61
Branch filter:
Location: libtransport.git/examples/external_network_plugin/main.cpp - annotation
2add374fbd61
1.0 KiB
text/x-c++hdr
working messaging and PM (only if you send it to user@server.tld, so normal PMs doesn't work yet)
0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 0a33a3100eb9 | #include "transport/config.h"
#include "transport/transport.h"
#include "transport/usermanager.h"
#include "transport/logger.h"
#include "transport/sqlite3backend.h"
#include "transport/userregistration.h"
#include "transport/networkpluginserver.h"
#include "Swiften/EventLoop/SimpleEventLoop.h"
using namespace Transport;
int main(void)
{
Config config;
if (!config.load("sample.cfg")) {
std::cout << "Can't open sample.cfg configuration file.\n";
return 1;
}
Swift::SimpleEventLoop eventLoop;
Component transport(&eventLoop, &config, NULL);
Logger logger(&transport);
SQLite3Backend sql(&config);
logger.setStorageBackend(&sql);
if (!sql.connect()) {
std::cout << "Can't connect to database.\n";
}
UserManager userManager(&transport, &sql);
UserRegistration userRegistration(&transport, &userManager, &sql);
logger.setUserRegistration(&userRegistration);
logger.setUserManager(&userManager);
NetworkPluginServer plugin(&transport, &config, &userManager);
transport.connect();
eventLoop.run();
}
|