~rcr/rirc

95f64b90d440e8037e4cfc6a20d83d2c68f3a8a4 — Richard Robbins a month ago ede3657
fix status line after disconnect
3 files changed, 9 insertions(+), 3 deletions(-)

M src/components/channel.c
M src/draw.c
M src/state.c
M src/components/channel.c => src/components/channel.c +1 -1
@@ 113,7 113,6 @@ void
channel_part(struct channel *c)
{
	channel_reset(c);
	c->joined = 0;
	c->parted = 1;
}



@@ 122,4 121,5 @@ channel_reset(struct channel *c)
{
	mode_reset(&(c->chanmodes), &(c->chanmodes_str));
	user_list_free(&(c->users));
	c->joined = 0;
}

M src/draw.c => src/draw.c +5 -1
@@ 677,7 677,11 @@ draw_status(struct channel *c)
	if (c->type == CHANNEL_T_CHANNEL && c->joined) {
		if (!drawf(&cols, STATUS_SEP_HORZ))
			return;
		if (!drawf(&cols, "[+%s %u]", c->chanmodes_str.str, c->users.count))
		if (!drawf(&cols, "[%s%s%s%u]",
				(*(c->chanmodes_str.str) ? "+" : ""),
				(*(c->chanmodes_str.str) ? c->chanmodes_str.str : ""),
				(*(c->chanmodes_str.str) ? " " : ""),
				 c->users.count))
			return;
	}


M src/state.c => src/state.c +3 -1
@@ 1072,6 1072,7 @@ io_cb_cxed(const void *cb_obj)
	struct server *s = (struct server *)cb_obj;

	int ret;

	server_reset(s);
	server_nicks_next(s);



@@ 1099,7 1100,7 @@ io_cb_dxed(const void *cb_obj)
	struct server *s = (struct server *)cb_obj;
	struct channel *c = s->channel;

	s->connected = 0;
	server_reset(s);

	do {
		newlinef(c, 0, FROM_ERROR, " -- disconnected --");


@@ 1107,6 1108,7 @@ io_cb_dxed(const void *cb_obj)
		c = c->next;
	} while (c != s->channel);

	draw(DRAW_STATUS);
	draw(DRAW_FLUSH);
}