QObject::connect(session, &IrcSession::connected, [this](){
connectedChanged();
connected();
+ announceDequeue();
});
QObject::connect(session, &IrcSession::disconnected, [this](){
return session->isConnected();
}
+void IrcCommunication::announceDequeue()
+{
+ foreach(QString s, announceQueue)
+ {
+ announce(s);
+ }
+ announceQueue.clear();
+}
+
void IrcCommunication::announce(QString s)
{
+ if(!isConnected())
+ {
+ announceQueue.append(s);
+ return;
+ }
+
qDebug()<<"channels: "<<mChannels;
foreach(QString channel, mChannels)
{
void setChannels(QStringList c) { mChannels = c; }
bool isConnected();
+ void announceDequeue();
public Q_SLOTS:
void respond(QString target, QString msg);
private:
bool mSsl;
+ QStringList announceQueue;
QStringList mChannels;
IrcSession *session;
};