mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Highlighting fixes with public messages.
/msg tab completion list growed to size of completion_keep_privates, the new nicks were removed from list instead of the old nicks. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@637 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
18a0499ce7
commit
cf7eb945ea
@ -50,7 +50,7 @@ static void print_channel_msg(IRC_SERVER_REC *server, const char *msg,
|
|||||||
IRC_CHANNEL_REC *chanrec;
|
IRC_CHANNEL_REC *chanrec;
|
||||||
NICK_REC *nickrec;
|
NICK_REC *nickrec;
|
||||||
const char *nickmode;
|
const char *nickmode;
|
||||||
int for_me, print_channel;
|
int for_me, print_channel, level;
|
||||||
char *color;
|
char *color;
|
||||||
|
|
||||||
chanrec = irc_channel_find(server, target);
|
chanrec = irc_channel_find(server, target);
|
||||||
@ -67,24 +67,27 @@ static void print_channel_msg(IRC_SERVER_REC *server, const char *msg,
|
|||||||
window_item_window((WI_ITEM_REC *) chanrec)->items->next != NULL)
|
window_item_window((WI_ITEM_REC *) chanrec)->items->next != NULL)
|
||||||
print_channel = TRUE;
|
print_channel = TRUE;
|
||||||
|
|
||||||
|
level = MSGLEVEL_PUBLIC |
|
||||||
|
(color != NULL ? MSGLEVEL_HILIGHT :
|
||||||
|
(for_me ? MSGLEVEL_HILIGHT : MSGLEVEL_NOHILIGHT));
|
||||||
if (!print_channel) {
|
if (!print_channel) {
|
||||||
/* message to active channel in window */
|
/* message to active channel in window */
|
||||||
if (color != NULL) {
|
if (color != NULL) {
|
||||||
/* highlighted nick */
|
/* highlighted nick */
|
||||||
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_HILIGHT,
|
printformat(server, target, level, IRCTXT_PUBMSG_HILIGHT,
|
||||||
IRCTXT_PUBMSG_HILIGHT, color, nick, msg, nickmode);
|
color, nick, msg, nickmode);
|
||||||
} else {
|
} else {
|
||||||
printformat(server, target, MSGLEVEL_PUBLIC | (for_me ? MSGLEVEL_HILIGHT : 0),
|
printformat(server, target, level,
|
||||||
for_me ? IRCTXT_PUBMSG_ME : IRCTXT_PUBMSG, nick, msg, nickmode);
|
for_me ? IRCTXT_PUBMSG_ME : IRCTXT_PUBMSG, nick, msg, nickmode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* message to not existing/active channel */
|
/* message to not existing/active channel */
|
||||||
if (color != NULL) {
|
if (color != NULL) {
|
||||||
/* highlighted nick */
|
/* highlighted nick */
|
||||||
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_HILIGHT,
|
printformat(server, target, level, IRCTXT_PUBMSG_HILIGHT_CHANNEL,
|
||||||
IRCTXT_PUBMSG_HILIGHT_CHANNEL, color, nick, target, msg, nickmode);
|
color, nick, target, msg, nickmode);
|
||||||
} else {
|
} else {
|
||||||
printformat(server, target, MSGLEVEL_PUBLIC | (for_me ? MSGLEVEL_HILIGHT : 0),
|
printformat(server, target, level,
|
||||||
for_me ? IRCTXT_PUBMSG_ME_CHANNEL : IRCTXT_PUBMSG_CHANNEL,
|
for_me ? IRCTXT_PUBMSG_ME_CHANNEL : IRCTXT_PUBMSG_CHANNEL,
|
||||||
nick, target, msg, nickmode);
|
nick, target, msg, nickmode);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ static int nick_completion_timeout(void)
|
|||||||
{
|
{
|
||||||
MODULE_SERVER_REC *mserver;
|
MODULE_SERVER_REC *mserver;
|
||||||
MODULE_CHANNEL_REC *mchannel;
|
MODULE_CHANNEL_REC *mchannel;
|
||||||
GSList *tmp, *link;
|
GSList *tmp;
|
||||||
time_t now;
|
time_t now;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
@ -153,8 +153,8 @@ static int nick_completion_timeout(void)
|
|||||||
mserver = MODULE_DATA(rec);
|
mserver = MODULE_DATA(rec);
|
||||||
len = g_slist_length(mserver->lastmsgs);
|
len = g_slist_length(mserver->lastmsgs);
|
||||||
if (len > 0 && len >= settings_get_int("completion_keep_privates")) {
|
if (len > 0 && len >= settings_get_int("completion_keep_privates")) {
|
||||||
link = g_slist_last(mserver->lastmsgs);
|
/* remove the oldest msg nick. */
|
||||||
last_msg_free(mserver, link->data);
|
last_msg_free(mserver, mserver->lastmsgs->data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,10 +341,8 @@ static GList *convert_msglist(GSList *msglist)
|
|||||||
while (msglist != NULL) {
|
while (msglist != NULL) {
|
||||||
LAST_MSG_REC *rec = msglist->data;
|
LAST_MSG_REC *rec = msglist->data;
|
||||||
|
|
||||||
list = g_list_append(list, g_strdup(rec->nick));
|
list = g_list_append(list, rec->nick);
|
||||||
|
|
||||||
msglist = g_slist_remove(msglist, rec);
|
msglist = g_slist_remove(msglist, rec);
|
||||||
g_free(rec->nick);
|
|
||||||
g_free(rec);
|
g_free(rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user