diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 28 | ||||
-rw-r--r-- | src/plugins/jabber/jabber-muc.c | 24 |
2 files changed, 32 insertions, 20 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index eae5a1238..734a4274b 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -72,6 +72,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type, { struct t_irc_channel *new_channel; struct t_gui_buffer *new_buffer; + int buffer_created; char *buffer_name; /* alloc memory for new channel */ @@ -84,6 +85,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type, } /* create buffer for channel (or use existing one) */ + buffer_created = 0; buffer_name = irc_buffer_build_name (server->name, channel_name); new_buffer = weechat_buffer_search (IRC_PLUGIN_NAME, buffer_name); if (new_buffer) @@ -98,21 +100,25 @@ irc_channel_new (struct t_irc_server *server, int channel_type, free (new_channel); return NULL; } - - weechat_buffer_set (new_buffer, "short_name", channel_name); - weechat_buffer_set (new_buffer, "localvar_set_type", - (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? "channel" : "private"); - weechat_buffer_set (new_buffer, "localvar_set_nick", server->nick); - weechat_buffer_set (new_buffer, "localvar_set_server", server->name); - weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); - + buffer_created = 1; + } + + weechat_buffer_set (new_buffer, "short_name", channel_name); + weechat_buffer_set (new_buffer, "localvar_set_type", + (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? "channel" : "private"); + weechat_buffer_set (new_buffer, "localvar_set_nick", server->nick); + weechat_buffer_set (new_buffer, "localvar_set_server", server->name); + weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); + + if (buffer_created) + { weechat_hook_signal_send ("logger_backlog", WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); - - if (weechat_config_boolean (irc_config_network_send_unknown_commands)) - weechat_buffer_set (new_buffer, "input_get_unknown_commands", "1"); } + if (weechat_config_boolean (irc_config_network_send_unknown_commands)) + weechat_buffer_set (new_buffer, "input_get_unknown_commands", "1"); + if (channel_type == IRC_CHANNEL_TYPE_CHANNEL) { weechat_buffer_set (new_buffer, "nicklist", "1"); diff --git a/src/plugins/jabber/jabber-muc.c b/src/plugins/jabber/jabber-muc.c index 74eb84ef3..eece05b9e 100644 --- a/src/plugins/jabber/jabber-muc.c +++ b/src/plugins/jabber/jabber-muc.c @@ -69,6 +69,7 @@ jabber_muc_new (struct t_jabber_server *server, int muc_type, { struct t_jabber_muc *new_muc; struct t_gui_buffer *new_buffer; + int buffer_created; char *buffer_name; /* alloc memory for new MUCl */ @@ -81,6 +82,7 @@ jabber_muc_new (struct t_jabber_server *server, int muc_type, } /* create buffer for MUC (or use existing one) */ + buffer_created = 0; buffer_name = jabber_buffer_build_name (server->name, muc_name); new_buffer = weechat_buffer_search (JABBER_PLUGIN_NAME, buffer_name); if (new_buffer) @@ -95,15 +97,19 @@ jabber_muc_new (struct t_jabber_server *server, int muc_type, free (new_muc); return NULL; } - - weechat_buffer_set (new_buffer, "short_name", muc_name); - weechat_buffer_set (new_buffer, "localvar_set_type", - (muc_type == JABBER_MUC_TYPE_MUC) ? "channel" : "private"); - weechat_buffer_set (new_buffer, "localvar_set_nick", - jabber_server_get_local_name (server)); - weechat_buffer_set (new_buffer, "localvar_set_server", server->name); - weechat_buffer_set (new_buffer, "localvar_set_muc", muc_name); - + buffer_created = 1; + } + + weechat_buffer_set (new_buffer, "short_name", muc_name); + weechat_buffer_set (new_buffer, "localvar_set_type", + (muc_type == JABBER_MUC_TYPE_MUC) ? "channel" : "private"); + weechat_buffer_set (new_buffer, "localvar_set_nick", + jabber_server_get_local_name (server)); + weechat_buffer_set (new_buffer, "localvar_set_server", server->name); + weechat_buffer_set (new_buffer, "localvar_set_muc", muc_name); + + if (buffer_created) + { weechat_hook_signal_send ("logger_backlog", WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); } |