summaryrefslogtreecommitdiff
path: root/src/plugins/relay
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-09-20 22:49:11 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-09-20 22:49:11 +0200
commit051788f7317487a6ca752f143d8a7270f693acd5 (patch)
tree0249e6ef8381ce50868205d0500b8af9a90b7470 /src/plugins/relay
parent1d3c3ffb92596c354d1ef5bad4a114388f766308 (diff)
downloadweechat-051788f7317487a6ca752f143d8a7270f693acd5.zip
Send channel topic to relay client when joining a channel
Diffstat (limited to 'src/plugins/relay')
-rw-r--r--src/plugins/relay/relay-client-irc.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/plugins/relay/relay-client-irc.c b/src/plugins/relay/relay-client-irc.c
index 1a36ef3a2..2cb5e058d 100644
--- a/src/plugins/relay/relay-client-irc.c
+++ b/src/plugins/relay/relay-client-irc.c
@@ -444,10 +444,10 @@ relay_client_irc_send_join (struct t_relay_client *client,
const char *channel)
{
char *infolist_name, *nicks;
- const char *nick, *prefix;
+ const char *nick, *prefix, *topic;
char *host;
int length, length_nicks;
- struct t_infolist *infolist_nick, *infolist_nicks;
+ struct t_infolist *infolist_nick, *infolist_channel, *infolist_nicks;
length = strlen (client->protocol_args) + 1 + strlen (channel) + 1
+ strlen (RELAY_IRC_DATA(client, nick)) + 1;
@@ -481,7 +481,26 @@ relay_client_irc_send_join (struct t_relay_client *client,
snprintf (infolist_name, length, "%s,%s",
client->protocol_args,
channel);
- infolist_nicks = weechat_infolist_get ("irc_nick", NULL, infolist_name);
+ infolist_channel = weechat_infolist_get ("irc_channel", NULL,
+ infolist_name);
+ if (infolist_channel)
+ {
+ if (weechat_infolist_next (infolist_channel))
+ {
+ topic = weechat_infolist_string (infolist_channel, "topic");
+ if (topic && topic[0])
+ {
+ relay_client_irc_sendf (client,
+ ":%s 332 %s %s :%s",
+ RELAY_IRC_DATA(client, address),
+ RELAY_IRC_DATA(client, nick),
+ channel, topic);
+ }
+ }
+ weechat_infolist_free (infolist_channel);
+ }
+ infolist_nicks = weechat_infolist_get ("irc_nick", NULL,
+ infolist_name);
if (infolist_nicks)
{
length_nicks = 0;