diff --git a/server/red-channel.c b/server/red-channel.c index a8ab5230..4229794d 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -429,6 +429,18 @@ void red_channel_init_outgoing_messages_window(RedChannel *channel) (GFunc)red_channel_client_init_outgoing_messages_window, NULL); } +void red_channel_pipes_add(RedChannel *channel, RedPipeItem *item) +{ + RedChannelClient *rcc; + + FOREACH_CLIENT(channel, rcc) { + red_pipe_item_ref(item); + red_channel_client_pipe_add(rcc, item); + } + + red_pipe_item_unref(item); +} + static void red_channel_client_pipe_add_type_proxy(gpointer data, gpointer user_data) { int type = GPOINTER_TO_INT(user_data); diff --git a/server/red-channel.h b/server/red-channel.h index 8ea5a711..a699f4e2 100644 --- a/server/red-channel.h +++ b/server/red-channel.h @@ -172,6 +172,12 @@ void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_type); void red_channel_pipes_add_empty_msg(RedChannel *channel, int msg_type); +/* Add an item to all the clients connected. + * The same item is shared between all clients. + * Function will take ownership of the item. + */ +void red_channel_pipes_add(RedChannel *channel, RedPipeItem *item); + /* return TRUE if all of the connected clients to this channel are blocked */ bool red_channel_all_blocked(RedChannel *channel);