示例#1
0
ThreadData* CMsnProto::MSN_StartSB(const char* wlid, bool& isOffline)
{
	isOffline = false;
	ThreadData *thread = MSN_GetThreadByContact(wlid);
	if (thread == NULL) {
		MCONTACT hContact = MSN_HContactFromEmail(wlid);
		WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
		if (wStatus != ID_STATUS_OFFLINE) {
			if (MSN_GetUnconnectedThread(wlid) == NULL && MsgQueue_CheckContact(wlid, 5) == NULL)
				msnNsThread->sendPacket("XFR", "SB");
		}
		else isOffline = true;
	}
	return thread;
}
示例#2
0
void CMsnProto::p2p_clearDormantSessions(void)
{
	mir_cslockfull lck(m_csSessions);

	time_t ts = time(NULL);
	for (int i = 0; i < m_arSessions.getCount(); i++) {
		filetransfer* FT = &m_arSessions[i];
		if (!FT->p2p_sessionid && !MSN_GetUnconnectedThread(FT->p2p_dest, SERVER_P2P_DIRECT))
			p2p_invite(FT->p2p_type, FT, NULL);
		else if (FT->p2p_waitack && (ts - FT->ts) > 120) {
			FT->bCanceled = true;
			p2p_sendCancel(FT);
			lck.unlock();
			p2p_unregisterSession(FT);
			lck.lock();
			i = 0;
		}
	}
}
示例#3
0
void  CMsnProto::p2p_clearDormantSessions(void)
{
	EnterCriticalSection(&sessionLock);

	time_t ts = time(NULL);
	for (int i=0; i < sessionList.getCount(); i++) 
	{
		filetransfer* FT = &sessionList[i];
		if (!FT->p2p_sessionid && !MSN_GetUnconnectedThread(FT->p2p_dest, SERVER_P2P_DIRECT))
			p2p_invite(FT->p2p_type, FT, NULL);
		else if (FT->p2p_waitack && (ts - FT->ts) > 120) 
		{
			FT->bCanceled = true;
			p2p_sendCancel(FT);
			LeaveCriticalSection(&sessionLock);
			p2p_unregisterSession(FT);
			EnterCriticalSection(&sessionLock);
			i = 0;
		}	
	}

	LeaveCriticalSection(&sessionLock);
}