mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-13 10:20:28 +00:00
Save channel creation time; new function Channel_CreationTime()
This commit is contained in:
parent
0d19f2b43a
commit
9bc5d565bb
@ -697,6 +697,14 @@ Channel_TopicWho(CHANNEL *Chan)
|
|||||||
return Chan->topic_who;
|
return Chan->topic_who;
|
||||||
} /* Channel_TopicWho */
|
} /* Channel_TopicWho */
|
||||||
|
|
||||||
|
|
||||||
|
GLOBAL unsigned int
|
||||||
|
Channel_CreationTime(CHANNEL *Chan)
|
||||||
|
{
|
||||||
|
assert(Chan != NULL);
|
||||||
|
return (unsigned int) Chan->creation_time;
|
||||||
|
} /* Channel_CreationTime */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -834,6 +842,9 @@ Channel_Create( const char *Name )
|
|||||||
strlcpy( c->name, Name, sizeof( c->name ));
|
strlcpy( c->name, Name, sizeof( c->name ));
|
||||||
c->hash = Hash( c->name );
|
c->hash = Hash( c->name );
|
||||||
c->next = My_Channels;
|
c->next = My_Channels;
|
||||||
|
#ifndef STRICT_RFC
|
||||||
|
c->creation_time = time(NULL);
|
||||||
|
#endif
|
||||||
My_Channels = c;
|
My_Channels = c;
|
||||||
LogDebug("Created new channel structure for \"%s\".", Name);
|
LogDebug("Created new channel structure for \"%s\".", Name);
|
||||||
return c;
|
return c;
|
||||||
|
@ -30,6 +30,7 @@ typedef struct _CHANNEL
|
|||||||
char modes[CHANNEL_MODE_LEN]; /* Channel modes */
|
char modes[CHANNEL_MODE_LEN]; /* Channel modes */
|
||||||
array topic; /* Topic of the channel */
|
array topic; /* Topic of the channel */
|
||||||
#ifndef STRICT_RFC
|
#ifndef STRICT_RFC
|
||||||
|
time_t creation_time; /* Channel creation time */
|
||||||
time_t topic_time; /* Time when topic was set */
|
time_t topic_time; /* Time when topic was set */
|
||||||
char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */
|
char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */
|
||||||
#endif
|
#endif
|
||||||
@ -118,6 +119,7 @@ GLOBAL CHANNEL *Channel_Create PARAMS(( const char *Name ));
|
|||||||
#ifndef STRICT_RFC
|
#ifndef STRICT_RFC
|
||||||
GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan ));
|
GLOBAL unsigned int Channel_TopicTime PARAMS(( CHANNEL *Chan ));
|
||||||
GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan ));
|
GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan ));
|
||||||
|
GLOBAL unsigned int Channel_CreationTime PARAMS(( CHANNEL *Chan ));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce ));
|
GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, bool OnlyOnce ));
|
||||||
|
Loading…
Reference in New Issue
Block a user