degesch: non-functional changes
This commit is contained in:
parent
883e777bac
commit
e8e039c11c
13
degesch.c
13
degesch.c
|
@ -1865,23 +1865,23 @@ irc_handle_join (struct app_context *ctx, const struct irc_message *msg)
|
|||
if (!msg->prefix || msg->params.len < 1)
|
||||
return;
|
||||
|
||||
const char *target = msg->params.vector[0];
|
||||
if (!irc_is_channel (ctx, target))
|
||||
const char *channel_name = msg->params.vector[0];
|
||||
if (!irc_is_channel (ctx, channel_name))
|
||||
return;
|
||||
|
||||
struct channel *channel = str_map_find (&ctx->irc_channels, target);
|
||||
struct buffer *buffer = str_map_find (&ctx->irc_buffer_map, target);
|
||||
struct channel *channel = str_map_find (&ctx->irc_channels, channel_name);
|
||||
struct buffer *buffer = str_map_find (&ctx->irc_buffer_map, channel_name);
|
||||
hard_assert ((channel && buffer) ||
|
||||
(channel && !buffer) || (!channel && !buffer));
|
||||
|
||||
// We've joined a new channel
|
||||
if (!channel && irc_is_this_us (ctx, msg->prefix))
|
||||
{
|
||||
channel = irc_make_channel (ctx, xstrdup (target));
|
||||
channel = irc_make_channel (ctx, xstrdup (channel_name));
|
||||
|
||||
buffer = buffer_new ();
|
||||
buffer->type = BUFFER_CHANNEL;
|
||||
buffer->name = xstrdup (target);
|
||||
buffer->name = xstrdup (channel_name);
|
||||
buffer->channel = channel_ref (channel);
|
||||
LIST_APPEND_WITH_TAIL (ctx->buffers, ctx->buffers_tail, buffer);
|
||||
str_map_set (&ctx->irc_buffer_map, channel->name, buffer);
|
||||
|
@ -2124,6 +2124,7 @@ irc_handle_privmsg (struct app_context *ctx, const struct irc_message *msg)
|
|||
if (buffer)
|
||||
{
|
||||
// TODO: handle CTCP messages
|
||||
// TODO: highlights
|
||||
buffer_send (ctx, buffer, BUFFER_LINE_PRIVMSG, 0,
|
||||
msg->prefix, NULL, "%s", message);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue