1340 |
COLOR_WIN_CHAT_NICK, "%s", host); |
COLOR_WIN_CHAT_NICK, "%s", host); |
1341 |
gui_printf_color (ptr_channel->buffer, |
gui_printf_color (ptr_channel->buffer, |
1342 |
COLOR_WIN_CHAT, " %s\n", pos); |
COLOR_WIN_CHAT, " %s\n", pos); |
1343 |
|
return 0; |
1344 |
} |
} |
1345 |
else if (strncmp (pos, "\01SOUND ", 7) == 0) |
if (strncmp (pos, "\01SOUND ", 7) == 0) |
1346 |
{ |
{ |
1347 |
pos += 7; |
pos += 7; |
1348 |
pos2 = strchr (pos, '\01'); |
pos2 = strchr (pos, '\01'); |
1355 |
gui_printf_color (ptr_channel->buffer, |
gui_printf_color (ptr_channel->buffer, |
1356 |
COLOR_WIN_CHAT_NICK, |
COLOR_WIN_CHAT_NICK, |
1357 |
"%s\n", host); |
"%s\n", host); |
1358 |
|
return 0; |
1359 |
} |
} |
1360 |
else |
if (strncmp (pos, "\01PING", 5) == 0) |
1361 |
{ |
{ |
1362 |
ptr_nick = nick_search (ptr_channel, host); |
pos += 5; |
1363 |
if (irc_is_highlight (pos, server->nick)) |
while (pos[0] == ' ') |
1364 |
|
pos++; |
1365 |
|
pos2 = strchr (pos, '\01'); |
1366 |
|
if (pos2) |
1367 |
|
pos2[0] = '\0'; |
1368 |
|
else |
1369 |
|
pos = NULL; |
1370 |
|
if (pos && !pos[0]) |
1371 |
|
pos = NULL; |
1372 |
|
if (pos) |
1373 |
|
server_sendf (server, "NOTICE %s :\01PING %s\01\r\n", |
1374 |
|
host, pos); |
1375 |
|
else |
1376 |
|
server_sendf (server, "NOTICE %s :\01PING\01\r\n", |
1377 |
|
host); |
1378 |
|
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER); |
1379 |
|
gui_printf_color (ptr_channel->buffer, |
1380 |
|
COLOR_WIN_CHAT, "CTCP "); |
1381 |
|
gui_printf_color (ptr_channel->buffer, |
1382 |
|
COLOR_WIN_CHAT_CHANNEL, "PING "); |
1383 |
|
gui_printf_color (ptr_channel->buffer, |
1384 |
|
COLOR_WIN_CHAT, _("received from")); |
1385 |
|
gui_printf_color (ptr_channel->buffer, |
1386 |
|
COLOR_WIN_CHAT_NICK, " %s\n", host); |
1387 |
|
return 0; |
1388 |
|
} |
1389 |
|
|
1390 |
|
/* unknown CTCP ? */ |
1391 |
|
pos2 = strchr (pos + 1, '\01'); |
1392 |
|
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0')) |
1393 |
|
{ |
1394 |
|
pos++; |
1395 |
|
pos2[0] = '\0'; |
1396 |
|
pos2 = strchr (pos, ' '); |
1397 |
|
if (pos2) |
1398 |
{ |
{ |
1399 |
irc_display_nick (ptr_channel->buffer, ptr_nick, |
pos2[0] = '\0'; |
1400 |
(ptr_nick) ? NULL : host, |
pos2++; |
1401 |
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, |
while (pos2[0] == ' ') |
1402 |
1, -1, 0); |
pos2++; |
1403 |
if ( (cfg_look_infobar) |
if (!pos2[0]) |
1404 |
&& (cfg_look_infobar_delay_highlight > 0) |
pos2 = NULL; |
|
&& (ptr_channel->buffer != gui_current_window->buffer) ) |
|
|
gui_infobar_printf (cfg_look_infobar_delay_highlight, |
|
|
COLOR_WIN_INFOBAR_HIGHLIGHT, |
|
|
_("On %s: %s> %s"), |
|
|
ptr_channel->name, |
|
|
host, pos); |
|
1405 |
} |
} |
1406 |
|
irc_display_prefix (ptr_channel->buffer, PREFIX_SERVER); |
1407 |
|
gui_printf_color (ptr_channel->buffer, |
1408 |
|
COLOR_WIN_CHAT, _("Unknown CTCP ")); |
1409 |
|
gui_printf_color (ptr_channel->buffer, |
1410 |
|
COLOR_WIN_CHAT_CHANNEL, "%s ", pos); |
1411 |
|
gui_printf_color (ptr_channel->buffer, |
1412 |
|
COLOR_WIN_CHAT, _("received from")); |
1413 |
|
gui_printf_color (ptr_channel->buffer, |
1414 |
|
COLOR_WIN_CHAT_NICK, " %s", host); |
1415 |
|
if (pos2) |
1416 |
|
gui_printf_color (ptr_channel->buffer, |
1417 |
|
COLOR_WIN_CHAT, ": %s\n", pos2); |
1418 |
else |
else |
1419 |
irc_display_nick (ptr_channel->buffer, ptr_nick, |
gui_printf (ptr_channel->buffer, "\n"); |
1420 |
(ptr_nick) ? NULL : host, |
return 0; |
|
MSG_TYPE_NICK, 1, 1, 0); |
|
|
gui_printf_type_color (ptr_channel->buffer, |
|
|
MSG_TYPE_MSG, |
|
|
COLOR_WIN_CHAT, "%s\n", pos); |
|
1421 |
} |
} |
1422 |
|
|
1423 |
|
/* other message */ |
1424 |
|
ptr_nick = nick_search (ptr_channel, host); |
1425 |
|
if (irc_is_highlight (pos, server->nick)) |
1426 |
|
{ |
1427 |
|
irc_display_nick (ptr_channel->buffer, ptr_nick, |
1428 |
|
(ptr_nick) ? NULL : host, |
1429 |
|
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, |
1430 |
|
1, -1, 0); |
1431 |
|
if ( (cfg_look_infobar) |
1432 |
|
&& (cfg_look_infobar_delay_highlight > 0) |
1433 |
|
&& (ptr_channel->buffer != gui_current_window->buffer) ) |
1434 |
|
gui_infobar_printf (cfg_look_infobar_delay_highlight, |
1435 |
|
COLOR_WIN_INFOBAR_HIGHLIGHT, |
1436 |
|
_("On %s: %s> %s"), |
1437 |
|
ptr_channel->name, |
1438 |
|
host, pos); |
1439 |
|
} |
1440 |
|
else |
1441 |
|
irc_display_nick (ptr_channel->buffer, ptr_nick, |
1442 |
|
(ptr_nick) ? NULL : host, |
1443 |
|
MSG_TYPE_NICK, 1, 1, 0); |
1444 |
|
gui_printf_type_color (ptr_channel->buffer, |
1445 |
|
MSG_TYPE_MSG, |
1446 |
|
COLOR_WIN_CHAT, "%s\n", pos); |
1447 |
} |
} |
1448 |
else |
else |
1449 |
{ |
{ |
1807 |
return 0; |
return 0; |
1808 |
} |
} |
1809 |
|
|
|
/* unknown CTCP ? */ |
|
|
pos2 = strchr (pos + 1, '\01'); |
|
|
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0')) |
|
|
{ |
|
|
pos++; |
|
|
pos2[0] = '\0'; |
|
|
pos2 = strchr (pos, ' '); |
|
|
if (pos2) |
|
|
{ |
|
|
pos2[0] = '\0'; |
|
|
pos2++; |
|
|
while (pos2[0] == ' ') |
|
|
pos2++; |
|
|
if (!pos2[0]) |
|
|
pos2 = NULL; |
|
|
} |
|
|
irc_display_prefix (server->buffer, PREFIX_SERVER); |
|
|
gui_printf_color (server->buffer, |
|
|
COLOR_WIN_CHAT, _("Unknown CTCP ")); |
|
|
gui_printf_color (server->buffer, |
|
|
COLOR_WIN_CHAT_CHANNEL, "%s ", pos); |
|
|
gui_printf_color (server->buffer, |
|
|
COLOR_WIN_CHAT, _("received from")); |
|
|
gui_printf_color (server->buffer, |
|
|
COLOR_WIN_CHAT_NICK, " %s", host); |
|
|
if (pos2) |
|
|
gui_printf_color (server->buffer, |
|
|
COLOR_WIN_CHAT, ": %s\n", pos2); |
|
|
else |
|
|
gui_printf (server->buffer, "\n"); |
|
|
return 0; |
|
|
} |
|
|
|
|
1810 |
/* private message received => display it */ |
/* private message received => display it */ |
1811 |
ptr_channel = channel_search (server, host); |
ptr_channel = channel_search (server, host); |
1812 |
if (!ptr_channel) |
if (!ptr_channel) |
1855 |
} |
} |
1856 |
else |
else |
1857 |
{ |
{ |
1858 |
gui_printf_type_color (ptr_channel->buffer, |
/* unknown CTCP ? */ |
1859 |
MSG_TYPE_NICK, |
pos2 = strchr (pos + 1, '\01'); |
1860 |
COLOR_WIN_CHAT_DARK, "<"); |
if ((pos[0] == '\01') && pos2 && (pos2[1] == '\0')) |
|
if (irc_is_highlight (pos, server->nick)) |
|
1861 |
{ |
{ |
1862 |
gui_printf_type_color (ptr_channel->buffer, |
pos++; |
1863 |
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, |
pos2[0] = '\0'; |
1864 |
COLOR_WIN_CHAT_HIGHLIGHT, |
pos2 = strchr (pos, ' '); |
1865 |
"%s", host); |
if (pos2) |
1866 |
if ( (cfg_look_infobar_delay_highlight > 0) |
{ |
1867 |
&& (ptr_channel->buffer != gui_current_window->buffer) ) |
pos2[0] = '\0'; |
1868 |
gui_infobar_printf (cfg_look_infobar_delay_highlight, |
pos2++; |
1869 |
COLOR_WIN_INFOBAR_HIGHLIGHT, |
while (pos2[0] == ' ') |
1870 |
_("Private %s> %s"), |
pos2++; |
1871 |
host, pos); |
if (!pos2[0]) |
1872 |
|
pos2 = NULL; |
1873 |
|
} |
1874 |
|
irc_display_prefix (server->buffer, PREFIX_SERVER); |
1875 |
|
gui_printf_color (server->buffer, |
1876 |
|
COLOR_WIN_CHAT, _("Unknown CTCP ")); |
1877 |
|
gui_printf_color (server->buffer, |
1878 |
|
COLOR_WIN_CHAT_CHANNEL, "%s ", pos); |
1879 |
|
gui_printf_color (server->buffer, |
1880 |
|
COLOR_WIN_CHAT, _("received from")); |
1881 |
|
gui_printf_color (server->buffer, |
1882 |
|
COLOR_WIN_CHAT_NICK, " %s", host); |
1883 |
|
if (pos2) |
1884 |
|
gui_printf_color (server->buffer, |
1885 |
|
COLOR_WIN_CHAT, ": %s\n", pos2); |
1886 |
|
else |
1887 |
|
gui_printf (server->buffer, "\n"); |
1888 |
|
return 0; |
1889 |
} |
} |
1890 |
else |
else |
1891 |
|
{ |
1892 |
gui_printf_type_color (ptr_channel->buffer, |
gui_printf_type_color (ptr_channel->buffer, |
1893 |
MSG_TYPE_NICK, |
MSG_TYPE_NICK, |
1894 |
COLOR_WIN_NICK_PRIVATE, |
COLOR_WIN_CHAT_DARK, "<"); |
1895 |
"%s", host); |
if (irc_is_highlight (pos, server->nick)) |
1896 |
gui_printf_type_color (ptr_channel->buffer, |
{ |
1897 |
MSG_TYPE_NICK, |
gui_printf_type_color (ptr_channel->buffer, |
1898 |
COLOR_WIN_CHAT_DARK, "> "); |
MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, |
1899 |
gui_printf_type_color (ptr_channel->buffer, |
COLOR_WIN_CHAT_HIGHLIGHT, |
1900 |
MSG_TYPE_MSG, |
"%s", host); |
1901 |
COLOR_WIN_CHAT, "%s\n", pos); |
if ( (cfg_look_infobar_delay_highlight > 0) |
1902 |
|
&& (ptr_channel->buffer != gui_current_window->buffer) ) |
1903 |
|
gui_infobar_printf (cfg_look_infobar_delay_highlight, |
1904 |
|
COLOR_WIN_INFOBAR_HIGHLIGHT, |
1905 |
|
_("Private %s> %s"), |
1906 |
|
host, pos); |
1907 |
|
} |
1908 |
|
else |
1909 |
|
gui_printf_type_color (ptr_channel->buffer, |
1910 |
|
MSG_TYPE_NICK, |
1911 |
|
COLOR_WIN_NICK_PRIVATE, |
1912 |
|
"%s", host); |
1913 |
|
gui_printf_type_color (ptr_channel->buffer, |
1914 |
|
MSG_TYPE_NICK, |
1915 |
|
COLOR_WIN_CHAT_DARK, "> "); |
1916 |
|
gui_printf_type_color (ptr_channel->buffer, |
1917 |
|
MSG_TYPE_MSG, |
1918 |
|
COLOR_WIN_CHAT, "%s\n", pos); |
1919 |
|
} |
1920 |
} |
} |
1921 |
} |
} |
1922 |
else |
else |