summaryrefslogtreecommitdiff
path: root/plugins/MessageState/src/clist_extra.cpp
blob: a4cf2e23f67ec646c2b952ee0cc98def4b7e4544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "stdafx.h"

HANDLE hExtraIcon = nullptr;

int ExtraIconsApply(WPARAM hContact, LPARAM force)
{
	if (hContact == NULL) return 0;

	if (HasUnread(hContact) || force)
		ExtraIcon_SetIcon(hExtraIcon, hContact, Icons[ICON_EXTRA].hIcolib);
	else
		ExtraIcon_Clear(hExtraIcon, hContact);

	return 0;
}

void InitClistExtraIcon()
{
	hExtraIcon = ExtraIcon_RegisterIcolib("messagestate_unread", LPGEN("MessageState unread extra icon"), "clist_unread_icon");
	HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply);
}