mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 11:24:00 +02:00
- fix for irc bug when leaving internet lobby too soon
This commit is contained in:
@@ -74,6 +74,8 @@ protected:
|
|||||||
Mutex mutexIRCCB;
|
Mutex mutexIRCCB;
|
||||||
IRCCallbackInterface *callbackObj;
|
IRCCallbackInterface *callbackObj;
|
||||||
|
|
||||||
|
bool wantToLeaveChannel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
IRCThread(const std::vector<string> &argv,IRCCallbackInterface *callbackObj);
|
IRCThread(const std::vector<string> &argv,IRCCallbackInterface *callbackObj);
|
||||||
@@ -81,6 +83,8 @@ public:
|
|||||||
virtual void signalQuit();
|
virtual void signalQuit();
|
||||||
virtual bool shutdownAndWait();
|
virtual bool shutdownAndWait();
|
||||||
|
|
||||||
|
bool getWantToLeaveChannel() const { return wantToLeaveChannel; }
|
||||||
|
|
||||||
void SendIRCCmdMessage(string target, string msg);
|
void SendIRCCmdMessage(string target, string msg);
|
||||||
std::vector<string> getNickList();
|
std::vector<string> getNickList();
|
||||||
bool isConnected();
|
bool isConnected();
|
||||||
|
@@ -159,6 +159,10 @@ void event_join(irc_session_t * session, const char * event, const char * origin
|
|||||||
nickList.push_back(realNick);
|
nickList.push_back(realNick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ctx->getWantToLeaveChannel() == true) {
|
||||||
|
ctx->leaveChannel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,6 +460,7 @@ IRCThread::IRCThread(const std::vector<string> &argv, IRCCallbackInterface *call
|
|||||||
eventDataDone = false;
|
eventDataDone = false;
|
||||||
hasJoinedChannel = false;
|
hasJoinedChannel = false;
|
||||||
lastNickListUpdate = time(NULL);
|
lastNickListUpdate = time(NULL);
|
||||||
|
wantToLeaveChannel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCThread::signalQuit() {
|
void IRCThread::signalQuit() {
|
||||||
@@ -727,6 +732,7 @@ void IRCThread::connectToHost() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IRCThread::joinChannel() {
|
void IRCThread::joinChannel() {
|
||||||
|
wantToLeaveChannel = false;
|
||||||
connectToHost();
|
connectToHost();
|
||||||
if(ircSession != NULL) {
|
if(ircSession != NULL) {
|
||||||
IRCThread *ctx = (IRCThread *)irc_get_ctx(ircSession);
|
IRCThread *ctx = (IRCThread *)irc_get_ctx(ircSession);
|
||||||
@@ -742,6 +748,7 @@ void IRCThread::joinChannel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IRCThread::leaveChannel() {
|
void IRCThread::leaveChannel() {
|
||||||
|
wantToLeaveChannel = true;
|
||||||
if(ircSession != NULL) {
|
if(ircSession != NULL) {
|
||||||
IRCThread *ctx = (IRCThread *)irc_get_ctx(ircSession);
|
IRCThread *ctx = (IRCThread *)irc_get_ctx(ircSession);
|
||||||
if(ctx != NULL) {
|
if(ctx != NULL) {
|
||||||
|
Reference in New Issue
Block a user