diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-27 08:30:00 -0400 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-27 08:30:00 -0400 | 
| commit | 83e92bf7487623c10567502936ca727f3a4c104c (patch) | |
| tree | 35e853f3a2e26582c0dc4938599a85518a41b5b0 /irc_channel.c | |
| parent | b95932eb5a897fd264f3762493285dd7037dccba (diff) | |
Topic handling changes.
Diffstat (limited to 'irc_channel.c')
| -rw-r--r-- | irc_channel.c | 12 | 
1 files changed, 10 insertions, 2 deletions
| diff --git a/irc_channel.c b/irc_channel.c index c58d6b1c..d15b73eb 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -108,13 +108,21 @@ int irc_channel_del_user( irc_channel_t *ic, irc_user_t *iu )  	return 1;  } -int irc_channel_set_topic( irc_channel_t *ic, const char *topic ) +int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_t *iu )  {  	g_free( ic->topic );  	ic->topic = g_strdup( topic ); +	g_free( ic->topic_who ); +	if( iu ) +		ic->topic_who = g_strdup_printf( "%s!%s@%s", iu->nick, iu->user, iu->host ); +	else +		ic->topic_who = NULL; +	 +	ic->topic_time = time( NULL ); +	  	if( ic->flags & IRC_CHANNEL_JOINED ) -		irc_send_topic( ic ); +		irc_send_topic( ic, TRUE );  	return 1;  } | 
