Skip to content

Commit

Permalink
Fixed IRC feed
Browse files Browse the repository at this point in the history
New version of library works faster as it skips some processes and the
way how we joined the channel after connect doesn't work with WMF
servers anymore as it asks to join channel too fast. Using the proper
auto join mechanism as now supported by the lib itself fixes the
problem.

Commented out some code we don't use.
  • Loading branch information
benapetr committed Mar 27, 2018
1 parent 0e1ef71 commit 79f9dc5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions huggle/hugglefeedproviderirc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,18 @@ bool HuggleFeedProviderIRC::Start()
qsrand(QTime::currentTime().msec());
nick += QString::number(qrand());
libirc::ServerAddress server(hcfg->IRCServer, false, hcfg->IRCPort, nick);
server.SetSuffix(this->GetSite()->IRCChannel);
this->Network = new libircclient::Network(server, "Wikimedia IRC");
this->Network->SetDefaultUsername(Configuration::HuggleConfiguration->HuggleVersion);
this->Network->SetDefaultIdent("huggle");
connect(this->Network, SIGNAL(Event_Connected()), this, SLOT(OnConnected()));
connect(this->Network, SIGNAL(Event_SelfJoin(libircclient::Channel*)), this, SLOT(OnIRCSelfJoin(libircclient::Channel*)));
connect(this->Network, SIGNAL(Event_SelfPart(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCSelfPart(libircclient::Parser*,libircclient::Channel*)));
//connect(this->Network, SIGNAL(Event_SelfJoin(libircclient::Channel*)), this, SLOT(OnIRCSelfJoin(libircclient::Channel*)));
//connect(this->Network, SIGNAL(Event_SelfPart(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCSelfPart(libircclient::Parser*,libircclient::Channel*)));
connect(this->Network, SIGNAL(Event_PRIVMSG(libircclient::Parser*)), this, SLOT(OnIRCChannelMessage(libircclient::Parser*)));
connect(this->Network, SIGNAL(Event_PerChannelQuit(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCChannelQuit(libircclient::Parser*,libircclient::Channel*)));
//connect(this->Network, SIGNAL(Event_PerChannelQuit(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCChannelQuit(libircclient::Parser*,libircclient::Channel*)));
connect(this->Network, SIGNAL(Event_Disconnected()), this, SLOT(OnDisconnected()));
connect(this->Network, SIGNAL(Event_Join(libircclient::Parser*,libircclient::User*,libircclient::Channel*)), this, SLOT(OnIRCUserJoin(libircclient::Parser*,libircclient::User*,libircclient::Channel*)));
connect(this->Network, SIGNAL(Event_Part(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCUserPart(libircclient::Parser*,libircclient::Channel*)));
//connect(this->Network, SIGNAL(Event_Join(libircclient::Parser*,libircclient::User*,libircclient::Channel*)), this, SLOT(OnIRCUserJoin(libircclient::Parser*,libircclient::User*,libircclient::Channel*)));
//connect(this->Network, SIGNAL(Event_Part(libircclient::Parser*,libircclient::Channel*)), this, SLOT(OnIRCUserPart(libircclient::Parser*,libircclient::Channel*)));
connect(this->Network, SIGNAL(Event_NetworkFailure(QString,int)), this, SLOT(OnFailure(QString,int)));
this->Connected = true;
this->Network->Connect();
Expand Down Expand Up @@ -320,7 +321,6 @@ void HuggleFeedProviderIRC::OnIRCChannelMessage(libircclient::Parser *px)

void HuggleFeedProviderIRC::OnConnected()
{
this->Network->RequestJoin(this->GetSite()->IRCChannel);
Huggle::Syslog::HuggleLogs->Log(_l("irc-connected", this->Site->Name));
this->Connected = true;
this->UptimeDate = QDateTime::currentDateTime();
Expand Down

0 comments on commit 79f9dc5

Please sign in to comment.