Files
@ c9cd2218b172
Branch filter:
Location: libtransport.git/backends/skype/main.cpp - annotation
c9cd2218b172
1.9 KiB
text/x-c++hdr
Slack: get the bot_access_token when requesting the token and use it to connect RTM
c643e5b81d60 7a3c38c46d32 7a3c38c46d32 c643e5b81d60 c643e5b81d60 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 78e71f9345c7 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c63df9499f11 c643e5b81d60 c63df9499f11 c643e5b81d60 7a3c38c46d32 7a3c38c46d32 ac2fd6dbfb75 c643e5b81d60 7c93aee6f49a c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 c643e5b81d60 1b8fef4d70b5 1b8fef4d70b5 1b8fef4d70b5 1b8fef4d70b5 c643e5b81d60 c643e5b81d60 7a3c38c46d32 c643e5b81d60 7a3c38c46d32 7a3c38c46d32 7a3c38c46d32 7a3c38c46d32 c643e5b81d60 712c55a9f486 7a3c38c46d32 7a3c38c46d32 7a3c38c46d32 7a3c38c46d32 060510d6958e 060510d6958e 060510d6958e 060510d6958e 712c55a9f486 712c55a9f486 712c55a9f486 060510d6958e c643e5b81d60 712c55a9f486 c643e5b81d60 712c55a9f486 c643e5b81d60 7a3c38c46d32 c643e5b81d60 7a3c38c46d32 c643e5b81d60 712c55a9f486 712c55a9f486 c643e5b81d60 712c55a9f486 712c55a9f486 c643e5b81d60 c643e5b81d60 7a3c38c46d32 c643e5b81d60 | #include "glib.h"
#include <dbus-1.0/dbus/dbus-glib-lowlevel.h>
#include "sqlite3.h"
#include <iostream>
#include "transport/Config.h"
#include "transport/Logging.h"
#include "transport/Transport.h"
#include "transport/UserManager.h"
#include "transport/MemoryUsage.h"
#include "transport/SQLite3Backend.h"
#include "transport/UserRegistration.h"
#include "transport/User.h"
#include "transport/StorageBackend.h"
#include "transport/RosterManager.h"
#include "transport/Conversation.h"
#include "transport/NetworkPlugin.h"
#include <boost/filesystem.hpp>
#include "sys/wait.h"
#include "sys/signal.h"
// #include "valgrind/memcheck.h"
#ifndef __FreeBSD__
#include "malloc.h"
#endif
#include "skype.h"
#include "skypeplugin.h"
DEFINE_LOGGER(logger, "backend");
using namespace Transport;
static void spectrum_sigchld_handler(int sig)
{
int status;
pid_t pid;
do {
pid = waitpid(-1, &status, WNOHANG);
} while (pid != 0 && pid != (pid_t)-1);
if ((pid == (pid_t) - 1) && (errno != ECHILD)) {
char errmsg[BUFSIZ];
snprintf(errmsg, BUFSIZ, "Warning: waitpid() returned %d", pid);
perror(errmsg);
}
}
static void log_glib_error(const gchar *string) {
LOG4CXX_ERROR(logger, "GLIB ERROR:" << string);
}
int main(int argc, char **argv) {
#ifndef WIN32
signal(SIGPIPE, SIG_IGN);
if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {
std::cout << "SIGCHLD handler can't be set\n";
return -1;
}
#endif
std::string host;
int port = 10000;
std::string error;
Config *cfg = Config::createFromArgs(argc, argv, error, host, port);
if (cfg == NULL) {
std::cerr << error;
return 1;
}
Logging::initBackendLogging(cfg);
g_type_init();
g_set_printerr_handler(log_glib_error);
dbus_threads_init_default();
SkypePlugin *np = new SkypePlugin(cfg, host, port);
GMainLoop *m_loop;
m_loop = g_main_loop_new(NULL, FALSE);
if (m_loop) {
g_main_loop_run(m_loop);
}
return 0;
}
|