ircclientstarter.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "ircclientstarter.h"
  2. IrcClientStarter::IrcClientStarter(ConnectionData conf, HttpServer* web, QObject *parent) :
  3. QObject(parent),
  4. m_ircClient(nullptr),
  5. m_webUi(web),
  6. m_conf(conf)
  7. {}
  8. void IrcClientStarter::RunInit()
  9. {
  10. m_ircClient = new IrcClient(m_conf, this);
  11. QObject::connect (m_ircClient, SIGNAL(userOnline(QString, QString, QStringList)),
  12. m_webUi, SLOT(ircUsersOnline(QString, QString, QStringList)),
  13. Qt::QueuedConnection);
  14. QObject::connect (m_ircClient, SIGNAL(myNickname(QString, QString)),
  15. m_webUi, SLOT(ircBotNick(QString, QString)),
  16. Qt::QueuedConnection);
  17. QObject::connect (m_ircClient, SIGNAL(topicChanged(QString, QString, QString)),
  18. m_webUi, SLOT(ircChannelTopic(QString, QString, QString)),
  19. Qt::QueuedConnection);
  20. QObject::connect (m_ircClient, SIGNAL(myOnline(QString, quint8)),
  21. m_webUi, SLOT(ircServerOnline(QString, quint8)),
  22. Qt::QueuedConnection);
  23. QObject::connect (m_ircClient, SIGNAL(startInfo(QString, QStringList)),
  24. m_webUi, SLOT(ircBotFirstInfo(QString, QStringList)),
  25. Qt::QueuedConnection);
  26. QObject::connect (m_ircClient, SIGNAL(newMessage(QString, QString, QString, QString)),
  27. m_webUi, SLOT(ircMessageCache(QString, QString, QString, QString)),
  28. Qt::QueuedConnection);
  29. m_ircClient->connectToServer();
  30. }