add IsAway() support
This commit is contained in:
parent
c670549ed1
commit
17f91486f4
5 changed files with 14 additions and 11 deletions
|
@ -4,7 +4,8 @@ Anything we add/remove/fix/change is in here (even our rants)
|
|||
Fish (F), Mark (M)
|
||||
===============================================================================
|
||||
* NeoStats * Version 3.0.prealpha3-dev
|
||||
- Add option to configure StatServ old channel time. (M)
|
||||
- API improvements fixing naming conventions and additional macro support. (M)
|
||||
- StatServ: Add option to configure old channel time. (M)
|
||||
- Add options to configure message flood sample time and threshold. (M)
|
||||
- StatServ: Since stats command only allows management of server stats,
|
||||
combined with server command. (M)
|
||||
|
|
|
@ -1205,6 +1205,9 @@ EXPORTFUNC int new_transfer( char *url, char *params, NS_TRANSFER savetofileorme
|
|||
/* Has NeoStats issued a SETHOST for this user? */
|
||||
#define IsUserSetHosted(x) ((x) && ((x)->flags & CLIENT_FLAG_SETHOST))
|
||||
|
||||
/* Is the client marked away? */
|
||||
#define IsAway(x) ( ( x ) && ( x->user->is_away ) )
|
||||
|
||||
EXPORTFUNC int ValidateNick( char *nick );
|
||||
EXPORTFUNC int ValidateUser( char *username );
|
||||
EXPORTFUNC int ValidateHost( char *hostname );
|
||||
|
@ -1301,9 +1304,9 @@ extern void nassert_fail( const char *expr, const char *file, const int line, co
|
|||
EXPORTFUNC void nlog( LOG_LEVEL level, char *fmt, ...) __attribute__((format(printf,2,3))); /* 2=format 3=params */
|
||||
EXPORTFUNC void dlog( DEBUG_LEVEL level, char *fmt, ...) __attribute__((format(printf,2,3))); /* 2=format 3=params */
|
||||
|
||||
typedef int (*ChannelListHandler) (Channel *c, void *v );
|
||||
typedef int (*ChannelListHandler) ( Channel *c, void *v );
|
||||
EXPORTFUNC int GetChannelList( ChannelListHandler handler, void *v );
|
||||
typedef int (*ChannelMemberHandler) (Channel *c, ChannelMember *m, void *v );
|
||||
typedef int (*ChannelMemberHandler) ( Channel *c, ChannelMember *m, void *v );
|
||||
EXPORTFUNC int GetChannelMembers( Channel *c, ChannelMemberHandler handler, void *v );
|
||||
|
||||
typedef int (*UserListHandler) ( Client *u, void *v );
|
||||
|
@ -1395,7 +1398,7 @@ MODULEFUNC void ModFini( void );
|
|||
MODULEVAR extern ModuleEvent module_events[];
|
||||
/* Module Auth Interface */
|
||||
MODULEFUNC int ModAuthUser( Client *u );
|
||||
|
||||
/* Module Exclude Interface */
|
||||
EXPORTFUNC int ModIsServerExcluded( Client *s );
|
||||
EXPORTFUNC int ModIsUserExcluded( Client *u );
|
||||
EXPORTFUNC int ModIsChannelExcluded( Channel *c );
|
||||
|
|
|
@ -132,7 +132,7 @@ static int operlist(Client *u, void * v)
|
|||
listu = (Client *)v;
|
||||
if (!IsOper(u))
|
||||
return NS_FALSE;
|
||||
if (operlistaway && u->user->is_away)
|
||||
if( operlistaway && IsAway( u ) )
|
||||
return NS_FALSE;
|
||||
if (!operlistserver) {
|
||||
irc_prefmsg (ss_bot, listu, "%-15s %-15s %-10d",
|
||||
|
|
|
@ -53,7 +53,6 @@ char *help_level_title[]=
|
|||
};
|
||||
|
||||
/* Intrinsic commands
|
||||
* (Work in progress, not yet operation)
|
||||
* These are all automatically added to a bot for handling
|
||||
* by the core. A module can override these by defining them
|
||||
* in it's local bot command array.
|
||||
|
|
10
src/users.c
10
src/users.c
|
@ -180,9 +180,9 @@ static void deluser (Client *u)
|
|||
hash_delete (userhash, un);
|
||||
hnode_destroy (un);
|
||||
list_destroy (u->user->chans);
|
||||
if (u->uplink)
|
||||
if( u->uplink )
|
||||
u->uplink->server->users--;
|
||||
if ((u->user->is_away == 1)) {
|
||||
if( IsAway( u ) ) {
|
||||
me.awaycount--;
|
||||
if (u->uplink)
|
||||
u->uplink->server->awaycount--;
|
||||
|
@ -303,11 +303,11 @@ void UserAway (const char *nick, const char *awaymsg)
|
|||
}
|
||||
cmdparams = (CmdParams*) ns_calloc (sizeof(CmdParams));
|
||||
cmdparams->source = u;
|
||||
if ((u->user->is_away == 1) && (!awaymsg)) {
|
||||
if( IsAway( u ) && ( !awaymsg ) ) {
|
||||
u->user->is_away = 0;
|
||||
me.awaycount--;
|
||||
u->uplink->server->awaycount--;
|
||||
} else if ((u->user->is_away == 0) && (awaymsg)) {
|
||||
} else if( !IsAway( u ) && ( awaymsg ) ) {
|
||||
u->user->is_away = 1;
|
||||
me.awaycount++;
|
||||
u->uplink->server->awaycount++;
|
||||
|
@ -406,7 +406,7 @@ static int dumpuser (Client *u, void* v)
|
|||
irc_prefmsg (ns_botptr, cmdparams->source, __("Flags: 0x%x", cmdparams->source), u->flags);
|
||||
irc_prefmsg (ns_botptr, cmdparams->source, __("Modes: %s (0x%x)", cmdparams->source), UmodeMaskToString(u->user->Umode), u->user->Umode);
|
||||
irc_prefmsg (ns_botptr, cmdparams->source, __("Smodes: %s (0x%x)", cmdparams->source), SmodeMaskToString(u->user->Smode), u->user->Smode);
|
||||
if (u->user->is_away) {
|
||||
if( IsAway( u ) ) {
|
||||
irc_prefmsg (ns_botptr, cmdparams->source, __("Away: %s", cmdparams->source), u->user->awaymsg);
|
||||
}
|
||||
irc_prefmsg (ns_botptr, cmdparams->source, __("Version: %s", cmdparams->source), u->version);
|
||||
|
|
Reference in a new issue