diff --git a/botthread.c b/botthread.c index 8dc56df..38aff60 100644 --- a/botthread.c +++ b/botthread.c @@ -19,6 +19,7 @@ char *tmp2 = 0x0; char *tok_last = 0x0; tuveChanList_t *tmpChan = 0x0; + tuveUserList_t *tmpUser = 0x0; MYSQL_RES *res = 0x0; MYSQL_ROW row; short dM = 0x0; @@ -203,15 +204,21 @@ } break; case 'S': + if (dM == 1) + for (tmpUser = tmpChan->users;tmpUser != 0x0;tmpUser = tmpUser->next) { + if (tmpUser->user == userConnection) { + tmpChan->nextUser = tmpUser; + } + } + tmpChan->nextUser = userConnection; + else + tmpChan->nextUser = tmpChan->users; + tmpChan->modes[CHAN_SCHEDULED] = dM; sprintf(output,"MSG:TUveD:%s:%s Sets Mode %cScheduled",chan,userConnection->userInfo.username,dMS[dM]); tuveSendAllInChan(chan,0x0,output); sprintf(output,"MODE:%s:S:%i",tmpChan->channel,dM); tuveSendAllInChan(chan,0x0,output); - if (dM == 1) - tmpChan->nextUser = userConnection; - else - tmpChan->nextUser = tmpChan->users; break; default: sSendData(userConnection,"MSG:TUveD:STATUS:Invalid Channel Mode");