Beispiel #1
0
int ChangeAvatar(MCONTACT hContact, bool fLoad, bool fNotifyHist, int pa_format)
{
	if (g_shutDown)
		return 0;

	hContact = GetContactThatHaveTheAvatar(hContact);

	// Get the node
	CacheNode *node = FindAvatarInCache(hContact, g_AvatarHistoryAvail && fNotifyHist, true);
	if (node == NULL)
		return 0;

	if (fNotifyHist)
		node->dwFlags |= AVH_MUSTNOTIFY;

	node->pa_format = pa_format;
	if (fLoad) {
		PushAvatarRequest(node);
		SetEvent(hLoaderEvent);
	}
	else
		node->wipeInfo();

	return 0;
}
Beispiel #2
0
INT_PTR GetAvatarBitmap(WPARAM hContact, LPARAM)
{
	if (hContact == 0 || g_shutDown || fei == NULL)
		return 0;

	hContact = GetContactThatHaveTheAvatar(hContact);

	// Get the node
	CacheNode *node = FindAvatarInCache(hContact, TRUE);
	if (node == NULL || !node->loaded)
		return (INT_PTR)GetProtoDefaultAvatar(hContact);
	return (INT_PTR)node;
}
Beispiel #3
0
INT_PTR GetAvatarBitmap(WPARAM wParam, LPARAM lParam)
{
	if (wParam == 0 || g_shutDown || fei == NULL)
		return 0;

	HANDLE hContact = (HANDLE) wParam;
	hContact = GetContactThatHaveTheAvatar(hContact);

	// Get the node
	CacheNode *node = FindAvatarInCache(hContact, TRUE);
	if (node == NULL || !node->loaded)
		return (INT_PTR) GetProtoDefaultAvatar(hContact);
	else
		return (INT_PTR) &node->ace;
}
Beispiel #4
0
// Return true if this contact has to be checked
static BOOL PollCheckContact(MCONTACT hContact, const char *szProto)
{
	return !db_get_b(hContact, "ContactPhoto", "Locked", 0) && FindAvatarInCache(hContact, FALSE, TRUE) != NULL;
}