* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
struct ChanUser *chanuser;
for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
if(botid && bot->botid != botid) continue;
struct ChanUser *chanuser;
for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
if(botid && bot->botid != botid) continue;
- if((chanuser = getChanUser(bot->user, chan)) != NULL) {
- if((chanuser->flags & CHANUSERFLAG_OPPED)) {
+ if(!chan || (chanuser = getChanUser(bot->user, chan)) != NULL) {
+ if(chan && (chanuser->flags & CHANUSERFLAG_OPPED)) {
invited = 1;
putsock(bot, "INVITE %s %s", user->nick, chan->name);
}
invited = 1;
putsock(bot, "INVITE %s %s", user->nick, chan->name);
}