mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
When sending /NAMES after join: Don't send lines longer than 512 chars -
non-irssi clients don't like them :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@822 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
76ca80087b
commit
82a3f10480
@ -138,25 +138,42 @@ void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void create_names_start(GString *str, IRC_CHANNEL_REC *channel,
|
||||||
|
CLIENT_REC *client)
|
||||||
|
{
|
||||||
|
g_string_sprintf(str, ":proxy 353 %s %c %s :", client->nick,
|
||||||
|
channel_mode_is_set(channel, 'p') ? '*' :
|
||||||
|
channel_mode_is_set(channel, 's') ? '@' : '=',
|
||||||
|
channel->name);
|
||||||
|
}
|
||||||
|
|
||||||
static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
|
static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
|
||||||
{
|
{
|
||||||
GSList *tmp, *nicks;
|
GSList *tmp, *nicks;
|
||||||
GString *str;
|
GString *str;
|
||||||
|
int first;
|
||||||
|
|
||||||
proxy_outserver(client, "JOIN %s", channel->name);
|
proxy_outserver(client, "JOIN %s", channel->name);
|
||||||
proxy_outdata(client, ":proxy 353 %s %c %s :", client->nick,
|
|
||||||
channel_mode_is_set(channel, 'p') ? '*' :
|
|
||||||
channel_mode_is_set(channel, 's') ? '@' : '=',
|
|
||||||
channel->name);
|
|
||||||
|
|
||||||
str = g_string_new(NULL);
|
str = g_string_new(NULL);
|
||||||
|
create_names_start(str, channel, client);
|
||||||
|
|
||||||
|
first = TRUE;
|
||||||
nicks = nicklist_getnicks(CHANNEL(channel));
|
nicks = nicklist_getnicks(CHANNEL(channel));
|
||||||
for (tmp = nicks; tmp != NULL; tmp = tmp->next) {
|
for (tmp = nicks; tmp != NULL; tmp = tmp->next) {
|
||||||
NICK_REC *nick = tmp->data;
|
NICK_REC *nick = tmp->data;
|
||||||
|
|
||||||
if (tmp != nicks)
|
if (str->len >= 500) {
|
||||||
|
g_string_append_c(str, '\n');
|
||||||
|
proxy_outdata(client, str->str);
|
||||||
|
create_names_start(str, channel, client);
|
||||||
|
first = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (first) {
|
||||||
g_string_append_c(str, ' ');
|
g_string_append_c(str, ' ');
|
||||||
|
first = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (nick->op)
|
if (nick->op)
|
||||||
g_string_append_c(str, '@');
|
g_string_append_c(str, '@');
|
||||||
|
Loading…
Reference in New Issue
Block a user