commit 9bc5d565bbbd1131aaa7608076598167036f261b from: Alexander Barton date: Thu Nov 11 11:39:19 2010 UTC Save channel creation time; new function Channel_CreationTime() commit - 0d19f2b43a0c5cc5c2c87e949bd3d32efcd2f935 commit + 9bc5d565bbbd1131aaa7608076598167036f261b blob - 175f23b253562118c9dc7f19b9fc82c0535187c4 blob + edbbc38bee3412d0c336833f34393bebab5323c8 --- src/ngircd/channel.c +++ src/ngircd/channel.c @@ -696,7 +696,15 @@ Channel_TopicWho(CHANNEL *Chan) assert(Chan != NULL); return Chan->topic_who; } /* Channel_TopicWho */ + +GLOBAL unsigned int +Channel_CreationTime(CHANNEL *Chan) +{ + assert(Chan != NULL); + return (unsigned int) Chan->creation_time; +} /* Channel_CreationTime */ + #endif @@ -834,6 +842,9 @@ Channel_Create( const char *Name ) strlcpy( c->name, Name, sizeof( c->name )); c->hash = Hash( c->name ); c->next = My_Channels; +#ifndef STRICT_RFC + c->creation_time = time(NULL); +#endif My_Channels = c; LogDebug("Created new channel structure for \"%s\".", Name); return c; blob - 46e7e13a8df2f233f1f5ab0cb2c2fc93ca99ed42 blob + 030f9109ceff0eb7bbfa42d435ead49740dc29da --- src/ngircd/channel.h +++ src/ngircd/channel.h @@ -30,6 +30,7 @@ typedef struct _CHANNEL char modes[CHANNEL_MODE_LEN]; /* Channel modes */ array topic; /* Topic of the channel */ #ifndef STRICT_RFC + time_t creation_time; /* Channel creation time */ time_t topic_time; /* Time when topic was set */ char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */ #endif @@ -118,6 +119,7 @@ GLOBAL CHANNEL *Channel_Create PARAMS(( const char *Na #ifndef STRICT_RFC GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan )); GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan )); +GLOBAL unsigned int Channel_CreationTime PARAMS(( CHANNEL *Chan )); #endif GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce ));