diff options
Diffstat (limited to 'protocols/Sametime/src')
| -rw-r--r-- | protocols/Sametime/src/conference.cpp | 18 | ||||
| -rw-r--r-- | protocols/Sametime/src/files.cpp | 38 | ||||
| -rw-r--r-- | protocols/Sametime/src/messaging.cpp | 8 | ||||
| -rw-r--r-- | protocols/Sametime/src/options.cpp | 6 | ||||
| -rw-r--r-- | protocols/Sametime/src/places.cpp | 2 | ||||
| -rw-r--r-- | protocols/Sametime/src/sametime.cpp | 6 | ||||
| -rw-r--r-- | protocols/Sametime/src/sametime_proto.cpp | 22 | ||||
| -rw-r--r-- | protocols/Sametime/src/sametime_session.cpp | 48 | ||||
| -rw-r--r-- | protocols/Sametime/src/session_announce_win.cpp | 2 | ||||
| -rw-r--r-- | protocols/Sametime/src/userlist.cpp | 64 | ||||
| -rw-r--r-- | protocols/Sametime/src/utils.cpp | 6 | 
11 files changed, 110 insertions, 110 deletions
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 6a517c6a94..c79baf20cb 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -4,7 +4,7 @@  void CloseMyConference(CSametimeProto* proto)
  {
  	mwConference_destroy(proto->my_conference, 0, Translate("I'm outa here."));
 -	proto->my_conference = 0;
 +	proto->my_conference = nullptr;
  }
  CSametimeProto* getProtoFromMwConference(mwConference* conf)
 @@ -45,7 +45,7 @@ void mwServiceConf_on_invited(mwConference* conf, mwLoginInfo* inviter, const ch  	wchar_t ws_invite[512];
  	MultiByteToWideChar(CP_UTF8, 0, (const char*)invite, -1, ws_invite, 128);
 -	if (MessageBoxW(0, ws_invite, ws_username, MB_OKCANCEL) == IDOK) {
 +	if (MessageBoxW(nullptr, ws_invite, ws_username, MB_OKCANCEL) == IDOK) {
  		proto->debugLogW(L"mwServiceConf_on_invited() mwConference_accept");
  		mwConference_accept(conf);
  	}
 @@ -64,7 +64,7 @@ void CSametimeProto::ClearInviteQueue()  		return;
  	mwIdBlock idb;
 -	idb.community = 0;
 +	idb.community = nullptr;
  	while(invite_queue.size()) {
  		idb.user = (char *)invite_queue.front().c_str();
 @@ -163,7 +163,7 @@ void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user)  	if (!hContact) {
  		mwIdBlock idb;
  		idb.user = ((mwLoginInfo *)user)->user_id;
 -		idb.community = 0;
 +		idb.community = nullptr;
  		mwSametimeList* user_list = mwSametimeList_new();
  		mwSametimeGroup* stgroup = mwSametimeGroup_new(user_list, mwSametimeGroup_NORMAL, T2Utf(TranslateT("None")));
 @@ -184,7 +184,7 @@ void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user)  	gce.ptszNick = tszUserName;
  	gce.ptszUID = tszUserId;
  	gce.ptszStatus = L"Normal";
 -	gce.time = (DWORD)time(0);
 +	gce.time = (DWORD)time(nullptr);
  	Chat_Event( &gce);
 @@ -209,7 +209,7 @@ void mwServiceConf_on_peer_parted(mwConference* conf, mwLoginInfo* user)  	gce.ptszNick = tszUserName;
  	gce.ptszUID = tszUserId;
  	gce.ptszStatus = L"Normal";
 -	gce.time = (DWORD)time(0);
 +	gce.time = (DWORD)time(nullptr);
  	Chat_Event(&gce);
  }
 @@ -229,7 +229,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh  	gce.ptszText = textT;
  	gce.ptszNick = tszUserName;
  	gce.ptszUID = tszUserId;
 -	gce.time = (DWORD)time(0);
 +	gce.time = (DWORD)time(nullptr);
  	Chat_Event(&gce);
  }
 @@ -427,12 +427,12 @@ void CSametimeProto::DeinitConference()  		g_list_free(conferences);
  	}
 -	my_login_info = 0;
 +	my_login_info = nullptr;
  	mwSession_removeService(session, mwService_CONFERENCE);
  	if (service_conference){
  		mwService_free((mwService*)service_conference);
 -		service_conference = 0;
 +		service_conference = nullptr;
  	}
  }
 diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index 0f30f5f06f..6d4813dbca 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -41,7 +41,7 @@ void mwFileTransfer_offered(mwFileTransfer* ft)  	PROTORECVFILET pre = {0};
  	pre.dwFlags = PRFF_UNICODE;
  	pre.fileCount = 1;
 -	pre.timestamp = time(NULL);
 +	pre.timestamp = time(nullptr);
  	pre.descr.w = descriptionT;
  	pre.files.w = &filenameT;
  	pre.lParam = (LPARAM)ft;
 @@ -58,7 +58,7 @@ int SendFileChunk(CSametimeProto* proto, mwFileTransfer* ft, FileTransferClientD  	if (!ftcd || !ftcd->buffer)
  		return 0;
 -	if (!ReadFile(ftcd->hFile, ftcd->buffer, FILE_BUFF_SIZE, &bytes_read, 0)) {
 +	if (!ReadFile(ftcd->hFile, ftcd->buffer, FILE_BUFF_SIZE, &bytes_read, nullptr)) {
  		proto->debugLogW(L"Sametime closing file transfer (SendFileChunk)");
  		mwFileTransfer_close(ft, mwFileTransfer_SUCCESS);
  		return 0;
 @@ -89,7 +89,7 @@ void __cdecl SendThread(LPVOID param) {  	if (ftcd->sending == 1)
  		pfts.flags |= PFTS_SENDING;
 -	pfts.pszFiles = NULL;
 +	pfts.pszFiles = nullptr;
  	pfts.totalFiles = ftcd->first->ft_count;
  	pfts.totalBytes = ftcd->first->totalSize;
 @@ -220,7 +220,7 @@ void mwFileTransfer_recv(mwFileTransfer* ft, struct mwOpaque* data)  	proto->debugLogW(L"mwFileTransfer_recv() start");
  	DWORD bytes_written;
 -	if (!WriteFile(ftcd->hFile, data->data, data->len, &bytes_written, 0)) {
 +	if (!WriteFile(ftcd->hFile, data->data, data->len, &bytes_written, nullptr)) {
  		proto->debugLogW(L"mwFileTransfer_recv() !WriteFile");
  		mwFileTransfer_cancel(ft);
  		proto->ProtoBroadcastAck(ftcd->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ftcd->hFt, 0);
 @@ -236,7 +236,7 @@ void mwFileTransfer_recv(mwFileTransfer* ft, struct mwOpaque* data)  		if (ftcd->sending == 1) {
  			pfts.flags |= PFTS_SENDING;
  		}
 -		pfts.pszFiles = NULL;
 +		pfts.pszFiles = nullptr;
  		pfts.totalFiles = 1;
  		pfts.currentFileNumber = 0;
  		pfts.totalBytes = mwFileTransfer_getFileSize(ft);
 @@ -292,13 +292,13 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const  		idb.user = id_block.user;
  		idb.community = id_block.community;
 -		FileTransferClientData *ftcd, *prev_ftcd = 0, *first_ftcd = 0;
 -		mwFileTransfer *ft, *first_ft = 0;
 +		FileTransferClientData *ftcd, *prev_ftcd = nullptr, *first_ftcd = nullptr;
 +		mwFileTransfer *ft, *first_ft = nullptr;
  		for (int i = 0; files[i]; i++) {
 -			HANDLE hFile = CreateFile(files[i], GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
 +			HANDLE hFile = CreateFile(files[i], GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
  			if (hFile != INVALID_HANDLE_VALUE) {
 -				DWORD filesize = GetFileSize(hFile, 0);
 +				DWORD filesize = GetFileSize(hFile, nullptr);
  				wchar_t *fn = wcsrchr(files[i], '\\');
  				if (fn)
 @@ -314,7 +314,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const  				ftcd->ft = ft;
  				ftcd->hContact = hContact;
 -				ftcd->next = 0;
 +				ftcd->next = nullptr;
  				if (prev_ftcd) {
  					prev_ftcd->next = ftcd; // link into list
 @@ -329,7 +329,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const  				ftcd->hFile = hFile;
  				ftcd->hFt = (HANDLE)first_ft;
 -				ftcd->save_path = 0;
 +				ftcd->save_path = nullptr;
  				ftcd->buffer = new char[FILE_BUFF_SIZE];
  				ftcd->ft_number = ftcd->first->ft_count;
 @@ -337,7 +337,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const  				ftcd->sizeToHere = ftcd->first->totalSize;
  				ftcd->first->totalSize += filesize;
 -				mwFileTransfer_setClientData(ft, (gpointer)ftcd, 0);
 +				mwFileTransfer_setClientData(ft, (gpointer)ftcd, nullptr);
  				prev_ftcd = ftcd;
  			}
 @@ -351,7 +351,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const  		}
  	}
 -	return 0;
 +	return nullptr;
  }
  HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* save_path)
 @@ -370,9 +370,9 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s  	if (save_path) // save path
  		ftcd->save_path = _strdup(save_path);
  	else
 -		ftcd->save_path = 0;
 +		ftcd->save_path = nullptr;
 -	mwFileTransfer_setClientData(ft, (gpointer)ftcd, 0);
 +	mwFileTransfer_setClientData(ft, (gpointer)ftcd, nullptr);
  	char fp[MAX_PATH];
  	char* fn = strrchr((char*)mwFileTransfer_getFileName(ft), '\\');
 @@ -386,16 +386,16 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s  	if (fn) mir_strcat(fp, fn);
  	else mir_strcat(fp, mwFileTransfer_getFileName(ft));
 -	ftcd->hFile = CreateFileA(fp, GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0);
 +	ftcd->hFile = CreateFileA(fp, GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, 0, nullptr);
  	if (ftcd->hFile == INVALID_HANDLE_VALUE) {
  		debugLogW(L"CSametimeProto::AcceptFileTransfer() INVALID_HANDLE_VALUE");
  		mwFileTransfer_close(ft, mwFileTransfer_ERROR);
 -		return 0;
 +		return nullptr;
  	}
  	ftcd->hContact = hContact;
 -	mwFileTransfer_setClientData(ft, (gpointer)ftcd, 0);
 +	mwFileTransfer_setClientData(ft, (gpointer)ftcd, nullptr);
  	mwFileTransfer_accept(ft);
  	return hFt;
 @@ -438,6 +438,6 @@ void CSametimeProto::DeinitFiles()  	debugLogW(L"CSametimeProto::DeinitFiles()");
  	mwSession_removeService(session, mwService_FILE_TRANSFER);
  	mwService_free((mwService*)service_files);
 -	service_files = 0;
 +	service_files = nullptr;
  }
 diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index 039aac3cb5..9b0fa0b9fb 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -82,7 +82,7 @@ void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpoint  		return;
  	PROTORECVEVENT pre = { 0 };
 -	time_t t = time(NULL);
 +	time_t t = time(nullptr);
  	pre.timestamp = t;
  	pre.szMessage = (char*)msg;
  	ProtoChainRecvMsg(hContact, &pre);
 @@ -109,7 +109,7 @@ mwImHandler mwIm_handler = {  	mwIm_conversation_closed,
  	mwIm_conversation_recv,
  	mwIm_place_invite,
 -	NULL
 +	nullptr
  };
  HANDLE CSametimeProto::SendMessageToUser(MCONTACT hContact, const char *szMsg)
 @@ -142,7 +142,7 @@ HANDLE CSametimeProto::SendMessageToUser(MCONTACT hContact, const char *szMsg)  		free(id_block.user);
  	}
 -	return 0;
 +	return nullptr;
  }
  void CSametimeProto::SendTyping(MCONTACT hContact, bool typing)
 @@ -200,5 +200,5 @@ void CSametimeProto::DeinitMessaging()  	debugLogW(L"CSametimeProto::DeinitMessaging()");
  	mwSession_removeService(session, mwService_IM);
  	mwService_free((mwService*)service_im);
 -	service_im = 0;
 +	service_im = nullptr;
  }
 diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index 86a5491d55..188f0afd79 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -235,9 +235,9 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA  					ofn.nMaxFile = MAX_PATH;
  					ofn.lpstrFilter = L"All\0*.*\0";
  					ofn.nFilterIndex = 1;
 -					ofn.lpstrFileTitle = NULL;
 +					ofn.lpstrFileTitle = nullptr;
  					ofn.nMaxFileTitle = 0;
 -					ofn.lpstrInitialDir = NULL;
 +					ofn.lpstrInitialDir = nullptr;
  					ofn.Flags = OFN_PATHMUSTEXIST;
  					if (GetOpenFileName(&ofn) == TRUE) {
 @@ -402,7 +402,7 @@ void CSametimeProto::LoadOptions()  	if (options.err_method == ED_POP && !ServiceExists(MS_POPUP_SHOWMESSAGE))
  		options.err_method = ED_BAL;
 -	debugLogW(L"LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]", options.server_name == NULL ? -1 : mir_strlen(options.server_name), options.id == NULL ? -1 : mir_strlen(options.id), options.pword == NULL ? -1 : mir_strlen(options.pword));
 +	debugLogW(L"LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]", options.server_name == nullptr ? -1 : mir_strlen(options.server_name), options.id == nullptr ? -1 : mir_strlen(options.id), options.pword == nullptr ? -1 : mir_strlen(options.pword));
  	debugLogW(L"LoadOptions() loaded: port=[%d], encrypt_session=[%d], ClientID=[%d], ClientVersionMajor=[%d], ClientVersionMinor=[%d]", options.port, options.encrypt_session, options.client_id, options.client_versionMajor, options.client_versionMinor);
  	debugLogW(L"LoadOptions() loaded: get_server_contacts=[%d], add_contacts=[%d], idle_as_away=[%d], err_method=[%d]", options.get_server_contacts, options.add_contacts, options.idle_as_away, options.err_method);
 diff --git a/protocols/Sametime/src/places.cpp b/protocols/Sametime/src/places.cpp index 3a45fa6f67..8b3a030ed1 100644 --- a/protocols/Sametime/src/places.cpp +++ b/protocols/Sametime/src/places.cpp @@ -63,5 +63,5 @@ void CSametimeProto::DeinitPlaces(mwSession* session)  	debugLogW(L"CSametimeProto::DeinitPlaces()");
  	mwSession_removeService(session, mwService_PLACE);
  	mwService_free((mwService*)service_places);
 -	service_places = 0;
 +	service_places = nullptr;
  }
 diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 0b78ced3f5..0987008bec 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -101,7 +101,7 @@ HANDLE GetIconHandle(int iconId)  	for (int i = 0; i < _countof(iconList); i++)
  		if (iconList[i].defIconID == iconId)
  			return iconList[i].hIcolib;
 -	return NULL;
 +	return nullptr;
  }
  HICON LoadIconEx(const char* name, bool big)
 @@ -152,7 +152,7 @@ void __cdecl sttFakeAckMessageFailedThread(void *param)  	proto->debugLogW(L"sttFakeAckMessageFailedThread() start");
  	Sleep(100);
 -	proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, tParam->lParam); ///TODO tParam->lParam: add error message
 +	proto->ProtoBroadcastAck(tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, tParam->lParam); ///TODO tParam->lParam: add error message
  	proto->debugLogW(L"sttFakeAckMessageFailedThread() end");
  	mir_free(tParam);
 @@ -175,7 +175,7 @@ int CSametimeProto::OnWindowEvent(WPARAM, LPARAM lParam)  {
  	MessageWindowEventData *mwed = (MessageWindowEventData*)lParam;
 -	if ((mwed == NULL) || db_get_b(mwed->hContact, m_szModuleName, "ChatRoom", 0))
 +	if ((mwed == nullptr) || db_get_b(mwed->hContact, m_szModuleName, "ChatRoom", 0))
  		return 0;
  	if ((mwed->uType == MSG_WINDOW_EVT_CLOSING) || (mwed->uType == MSG_WINDOW_EVT_CLOSE))
 diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 2013429bbc..3fb384cb38 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -6,12 +6,12 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN  	is_idle(false), idle_status(false),
  	first_online(true),
  	idle_timerid(0),
 -	session(NULL),
 -	my_login_info(NULL),
 -	my_conference(NULL),
 -	service_places(NULL),
 -	service_conference(NULL),
 -	server_connection(0)
 +	session(nullptr),
 +	my_login_info(nullptr),
 +	my_conference(nullptr),
 +	service_places(nullptr),
 +	service_conference(nullptr),
 +	server_connection(nullptr)
  {
  	// Register m_hNetlibUser user
  	wchar_t name[128];
 @@ -159,7 +159,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType)  HANDLE CSametimeProto::SearchBasic(const wchar_t* id)
  {
 -	debugLogW(L"CSametimeProto::SearchBasic()  id:len=[%d]", id == NULL ? -1 : mir_wstrlen(id));
 +	debugLogW(L"CSametimeProto::SearchBasic()  id:len=[%d]", id == nullptr ? -1 : mir_wstrlen(id));
  	return (HANDLE)SearchForUser(T2Utf(id), FALSE);
  	///TODO - add timeout (like at GGPROTO::searchthread)
  }
 @@ -171,7 +171,7 @@ HWND CSametimeProto::SearchAdvanced(HWND owner)  		debugLogW(L"CSametimeProto::SearchAdvanced()  buf:len=[%d]", mir_wstrlen(buf));
  		return (HWND)SearchForUser(T2Utf(buf), TRUE);
  	}
 -	return NULL;
 +	return nullptr;
  }
  HWND CSametimeProto::CreateExtendedSearchUI(HWND owner)
 @@ -211,7 +211,7 @@ HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription,  			}
  		}
  	}
 -	return 0; // failure
 +	return nullptr; // failure
  }
  int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg)
 @@ -270,7 +270,7 @@ HANDLE CSametimeProto::GetAwayMsg(MCONTACT hContact)  		mir_forkthread(sttRecvAwayThread, tfap);
  		return (HANDLE)1;
  	}
 -	return NULL;
 +	return nullptr;
  }
  int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt)
 @@ -284,7 +284,7 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt  int CSametimeProto::SetAwayMsg(int iStatus, const wchar_t* msg)
  {
 -	debugLogW(L"CSametimeProto::SetAwayMsg()  iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_wstrlen(msg));
 +	debugLogW(L"CSametimeProto::SetAwayMsg()  iStatus=[%d], msg:len=[%d]", iStatus, msg == nullptr ? -1 : mir_wstrlen(msg));
  	SetSessionAwayMessage(iStatus, msg);
  	return 0;
  }
 diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 154a165f83..3646cc2f34 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -35,7 +35,7 @@ void __cdecl SessionClose(mwSession* session)  	CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
  	proto->debugLogW(L"SessionClose()  server_connection=[%d]", proto->server_connection);
  	Netlib_CloseHandle(proto->server_connection);
 -	proto->server_connection = 0;
 +	proto->server_connection = nullptr;
  }
  void CSametimeProto::SessionStarted()
 @@ -64,14 +64,14 @@ void CSametimeProto::InitMeanwhileServices()  	InitFiles();
  	InitConference();
 -	mwSession_setProperty(session, "PROTO_STRUCT_PTR", this, NULL);
 +	mwSession_setProperty(session, "PROTO_STRUCT_PTR", this, nullptr);
 -	mwSession_setProperty(session, mwSession_AUTH_USER_ID, options.id, NULL);
 -	mwSession_setProperty(session, mwSession_AUTH_PASSWORD, options.pword, NULL);
 -	mwSession_setProperty(session, mwSession_CLIENT_TYPE_ID, (void*)options.client_id, NULL);
 +	mwSession_setProperty(session, mwSession_AUTH_USER_ID, options.id, nullptr);
 +	mwSession_setProperty(session, mwSession_AUTH_PASSWORD, options.pword, nullptr);
 +	mwSession_setProperty(session, mwSession_CLIENT_TYPE_ID, (void*)options.client_id, nullptr);
 -	mwSession_setProperty(session, mwSession_CLIENT_VER_MAJOR, (void*)options.client_versionMajor, NULL);
 -	mwSession_setProperty(session, mwSession_CLIENT_VER_MINOR, (void*)options.client_versionMinor, NULL);
 +	mwSession_setProperty(session, mwSession_CLIENT_VER_MAJOR, (void*)options.client_versionMajor, nullptr);
 +	mwSession_setProperty(session, mwSession_CLIENT_VER_MINOR, (void*)options.client_versionMinor, nullptr);
  }
 @@ -138,7 +138,7 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text)  	CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
  	proto->debugLogW(L"SessionAdmin()");
  	wchar_t* tt = mir_utf8decodeW(text);
 -	MessageBox(0, tt, TranslateT("Sametime administrator message"), MB_OK);
 +	MessageBox(nullptr, tt, TranslateT("Sametime administrator message"), MB_OK);
  	mir_free(tt);
  }
 @@ -152,7 +152,7 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from  	stzFrom = mir_utf8decodeW(from->user_name);
  	stzText = mir_utf8decodeW(text);
  	mir_snwprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
 -	MessageBox(0, TranslateW(stzText), stzFromBuff, MB_OK);
 +	MessageBox(nullptr, TranslateW(stzText), stzFromBuff, MB_OK);
  	mir_free(stzText);
  	mir_free(stzFrom);
  }
 @@ -243,9 +243,9 @@ int CSametimeProto::SetSessionStatus(int status)  	struct mwUserStatus us;
  	debugLogW(L"SetSessionStatus() start  status=[%d]", status);
 -	if (idle_timerid) KillTimer(0, idle_timerid);
 +	if (idle_timerid) KillTimer(nullptr, idle_timerid);
 -	us.time = (DWORD)time(0);
 +	us.time = (DWORD)time(nullptr);
  	//us.time = 0;
  	switch (status) {
 @@ -271,7 +271,7 @@ int CSametimeProto::SetSessionStatus(int status)  		us.desc = AwayMessages.szOnline; us.status = mwStatus_ACTIVE; break;
  	}
 -	debugLogW(L"SetSessionStatus() mwSession_setUserStatus  us.status=[%d], us.desc:len=[%d]", us.status, us.desc == NULL ? -1 : mir_strlen(us.desc));
 +	debugLogW(L"SetSessionStatus() mwSession_setUserStatus  us.status=[%d], us.desc:len=[%d]", us.status, us.desc == nullptr ? -1 : mir_strlen(us.desc));
  	mwSession_setUserStatus(session, &us);
  	return 0;
 @@ -281,14 +281,14 @@ VOID CALLBACK IdleTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime  {
  	CSametimeProto* proto = (CSametimeProto*)idEvent;
 -	KillTimer(0, proto->idle_timerid);
 +	KillTimer(nullptr, proto->idle_timerid);
  	proto->idle_timerid = 0;
  	if (proto->idle_status) {
  		struct mwUserStatus us;
 -		us.time = (DWORD)time(0);
 +		us.time = (DWORD)time(nullptr);
  		us.status = mwStatus_IDLE;
 -		us.desc = 0;
 +		us.desc = nullptr;
  		mwSession_setUserStatus(proto->session, &us);
  	}
  	else proto->SetSessionStatus(proto->m_iStatus);
 @@ -301,19 +301,19 @@ int CSametimeProto::SetIdle(bool idle)  	if (idle && !idle_status) {
  		idle_status = true;
  		if (!idle_timerid)
 -			idle_timerid = SetTimer(0, (UINT_PTR)this, 200, IdleTimerProc);
 +			idle_timerid = SetTimer(nullptr, (UINT_PTR)this, 200, IdleTimerProc);
  	}
  	else if (idle_status) {
  		idle_status = false;
  		if (!idle_timerid)
 -			idle_timerid = SetTimer(0, (UINT_PTR)this, 200, IdleTimerProc);
 +			idle_timerid = SetTimer(nullptr, (UINT_PTR)this, 200, IdleTimerProc);
  	}
  	return 0;
  }
  void CSametimeProto::SetSessionAwayMessage(int status, const wchar_t* msgT)
  {
 -	debugLogW(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_wstrlen(msgT));
 +	debugLogW(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == nullptr ? -1 : mir_wstrlen(msgT));
  	T2Utf msg(msgT);
  	if (status == ID_STATUS_ONLINE)
 @@ -408,7 +408,7 @@ void __cdecl SessionThread(LPVOID param)  		return;
  	}
 -	mwSessionHandler handler = { 0 };
 +	mwSessionHandler handler = {};
  	handler.clear = SessionClear;
  	handler.io_write = SessionWrite;
  	handler.io_close = SessionClose;
 @@ -453,7 +453,7 @@ void __cdecl SessionThread(LPVOID param)  	mir_cslock lck2(proto->session_cs);
  	proto->DeinitMeanwhileServices();
  	mwSession* old_session = proto->session;
 -	proto->session = 0; // kills keepalive thread, if awake
 +	proto->session = nullptr; // kills keepalive thread, if awake
  	mwSession_free(old_session);
  	proto->BroadcastNewStatus(ID_STATUS_OFFLINE);
 @@ -536,10 +536,10 @@ int CSametimeProto::OnLogInRedirect(char* newHost)  void CSametimeProto::InitAwayMsg()
  {
 -	AwayMessages.szOnline = 0;
 -	AwayMessages.szAway = 0;
 -	AwayMessages.szDND = 0;
 -	AwayMessages.szOccupied = 0;
 +	AwayMessages.szOnline = nullptr;
 +	AwayMessages.szAway = nullptr;
 +	AwayMessages.szDND = nullptr;
 +	AwayMessages.szOccupied = nullptr;
  }
  void CSametimeProto::DeinitAwayMsg()
 diff --git a/protocols/Sametime/src/session_announce_win.cpp b/protocols/Sametime/src/session_announce_win.cpp index 99b85c6bb3..45c4dffa2d 100644 --- a/protocols/Sametime/src/session_announce_win.cpp +++ b/protocols/Sametime/src/session_announce_win.cpp @@ -91,7 +91,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara  					char *p = id + 2;		// it's wrong - it works for a list of user id's with no prefix - so we'll do both
  					// build recipient list
 -					safArg->recipients = 0;
 +					safArg->recipients = nullptr;
  					int size = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_LST_ANTO));
  					int send_count = 0;
 diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 11c8591827..a61398189a 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -25,7 +25,7 @@ bool CSametimeProto::GetAwareIdFromContact(MCONTACT hContact, mwAwareIdBlock* id  			if (dbv.pszVal) {
  				id_block->type = mwAware_USER;
  				id_block->user = _strdup(dbv.pszVal);
 -				id_block->community = 0;
 +				id_block->community = nullptr;
  				db_free(&dbv);
  				return true;
  			}
 @@ -104,7 +104,7 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary)  		//add to our awareness list
  		mwAwareIdBlock id_block;
  		if (GetAwareIdFromContact(hContact, &id_block)) {
 -			GList* gl = g_list_prepend(NULL, &id_block);
 +			GList* gl = g_list_prepend(nullptr, &id_block);
  			mwAwareList_addAware(aware_list, gl);
  			g_list_free(gl);
  			free(id_block.user);
 @@ -164,9 +164,9 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp  			mwAwareIdBlock id_block;
  			id_block.type = mwAware_GROUP;
  			id_block.user = (char*)group_name;
 -			id_block.community = 0;
 +			id_block.community = nullptr;
 -			GList* gl = g_list_prepend(NULL, &id_block);
 +			GList* gl = g_list_prepend(nullptr, &id_block);
  			mwAwareList_addAware(aware_list, gl);
  			g_list_free(gl);
  		}
 @@ -188,7 +188,7 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp  void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
  {
  	debugLogW(L"CSametimeProto::ExportContactsToList() start");
 -	mwSametimeGroup* stgroup = 0;
 +	mwSametimeGroup* stgroup = nullptr;
  	char* group_name;
  	char* group_alias;
  	mwSametimeGroupType group_type;
 @@ -203,7 +203,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)  	mwAwareIdBlock id_block;
  	mwIdBlock uid;
 -	GList* gl = 0;
 +	GList* gl = nullptr;
  	for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
  		if (!db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
  			if (dbv.pszVal) {
 @@ -249,7 +249,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)  							group_open = (db_get_b(0, szProtoGroups, buff, 0) == 1);
  						}
 -						stgroup = 0;
 +						stgroup = nullptr;
  						stgroup = mwSametimeList_findGroup(user_list, group_name);
  						if (!stgroup) {
  							if (group_name) stgroup = mwSametimeGroup_new(user_list, group_type, group_name);
 @@ -265,14 +265,14 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)  							db_free(&dbv2);
  						}
  						else
 -							user_shortName = 0;
 +							user_shortName = nullptr;
  						if (!db_get_utf(hContact, "CList", "MyHandle", &dbv2)) {
  							user_alias = _strdup(dbv2.pszVal);
  							db_free(&dbv2);
  						}
  						else
 -							user_alias = 0;
 +							user_alias = nullptr;
  						user_type = (mwSametimeUserType)db_get_b(hContact, m_szModuleName, "type", (BYTE)mwSametimeUser_NORMAL);
 @@ -346,7 +346,7 @@ void CSametimeProto::ExportContactsToServer()  	mwPutBuffer_finalize(op, buff);
  	/* save the storage unit to the service */
 -	mwServiceStorage_save(service_storage, unit, NULL, NULL, NULL);
 +	mwServiceStorage_save(service_storage, unit, nullptr, nullptr, nullptr);
  }
 @@ -376,7 +376,7 @@ void CSametimeProto::UserListAddStored()  {
  	mwStorageUnit* unit;
  	unit = mwStorageUnit_new(mwStore_AWARE_LIST);
 -	mwServiceStorage_load(service_storage, unit, &load_users_callback, (gpointer)this, 0);
 +	mwServiceStorage_load(service_storage, unit, &load_users_callback, (gpointer)this, nullptr);
  }
  int CSametimeProto::ContactDeleted(MCONTACT hContact)
 @@ -389,7 +389,7 @@ int CSametimeProto::ContactDeleted(MCONTACT hContact)  	debugLogW(L"CSametimeProto::ContactDeleted()");
  	if (GetAwareIdFromContact(hContact, &id_block)) {
 -		GList* gl = g_list_prepend(NULL, &id_block);
 +		GList* gl = g_list_prepend(nullptr, &id_block);
  		mwAwareList_removeAware(aware_list, gl);
  		g_list_free(gl);
  		free(id_block.user);
 @@ -413,7 +413,7 @@ void mwResolve_handler_dyngroup_callback(mwServiceResolve* srvc, guint32 id, gui  	mwResolveResult* result;
  	mwResolveMatch* match;
 -	g_return_if_fail(results != NULL);
 +	g_return_if_fail(results != nullptr);
  	if (results) {
  		result = (mwResolveResult*)results->data;
 @@ -423,7 +423,7 @@ void mwResolve_handler_dyngroup_callback(mwServiceResolve* srvc, guint32 id, gui  			if (match) {
  				mwIdBlock uid;
  				uid.user = match->id;
 -				uid.community = 0;
 +				uid.community = nullptr;
  				mwSametimeUser *stuser = mwSametimeUser_new(stgroup, mwSametimeUser_NORMAL, &uid);
  				mwSametimeUser_setShortName(stuser, match->name);
 @@ -457,7 +457,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware)  	CSametimeProto* proto = getProtoFromMwAwareList(list);;
  	MCONTACT hContact = proto->FindContactByUserId(aware->id.user);
 -	char* group = 0;
 +	char* group = nullptr;
  	DBVARIANT dbv;
  	// update self - necessary for some servers
 @@ -504,8 +504,8 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware)  			db_free(&dbv);
  		}
 -		GList* query = g_list_prepend(0, aware->id.user);
 -		mwServiceResolve_resolve(proto->service_resolve, query, mwResolveFlag_USERS, mwResolve_handler_dyngroup_callback, (gpointer)stgroup, 0);
 +		GList* query = g_list_prepend(nullptr, aware->id.user);
 +		mwServiceResolve_resolve(proto->service_resolve, query, mwResolveFlag_USERS, mwResolve_handler_dyngroup_callback, (gpointer)stgroup, nullptr);
  		g_list_free(query);
  	}
 @@ -530,7 +530,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware)  					new_status = ID_STATUS_AWAY;
  					db_set_w(hContact, proto->m_szModuleName, "Status", new_status);
  				}
 -				db_set_dw(hContact, proto->m_szModuleName, "IdleTS", (DWORD)time(0));
 +				db_set_dw(hContact, proto->m_szModuleName, "IdleTS", (DWORD)time(nullptr));
  				break;
  			case mwStatus_BUSY:
  				new_status = ID_STATUS_DND;
 @@ -593,7 +593,7 @@ void CSametimeProto::UserListCreate()  	DBVARIANT dbv;
  	mwAwareIdBlock id_block;
 -	GList *gl = 0;
 +	GList *gl = nullptr;
  	for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
  		if (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0 /*&&  proto && !mir_strcmp( PROTO, proto)*/) {
 @@ -601,7 +601,7 @@ void CSametimeProto::UserListCreate()  				if (dbv.pszVal) {
  					if (GetAwareIdFromContact(hContact, &id_block)) {
  						// add user to aware list
 -						gl = g_list_prepend(0, &id_block);
 +						gl = g_list_prepend(nullptr, &id_block);
  						mwAwareList_addAware(aware_list, gl);
  						free(id_block.user);
  						g_list_free(gl);
 @@ -616,9 +616,9 @@ void CSametimeProto::UserListCreate()  	if (!db_get_utf(0, m_szModuleName, "stid", &dbv)) {
  		id_block.type = mwAware_USER;
  		id_block.user = dbv.pszVal;
 -		id_block.community = 0;
 +		id_block.community = nullptr;
 -		gl = g_list_prepend(0, &id_block);
 +		gl = g_list_prepend(nullptr, &id_block);
  		mwAwareList_addAware(aware_list, gl);
  		g_list_free(gl);
 @@ -629,7 +629,7 @@ void CSametimeProto::UserListCreate()  void CSametimeProto::UserListDestroy()
  {
  	mwAwareList_free(aware_list);
 -	aware_list = 0;
 +	aware_list = nullptr;
  }
  void CSametimeProto::UserRecvAwayMessage(MCONTACT hContact)
 @@ -733,8 +733,8 @@ void mwResolve_handler_details_callback(mwServiceResolve* srvc, guint32 id, guin  int CSametimeProto::SearchForUser(const char* name, BOOLEAN advanced)
  {
  	if (m_iStatus != ID_STATUS_OFFLINE && service_resolve) {
 -		GList *query = g_list_prepend(0, (gpointer) name);
 -		guint32 id = mwServiceResolve_resolve(service_resolve, query, (mwResolveFlag)(mwResolveFlag_USERS | mwResolveFlag_GROUPS), &mwResolve_handler_callback, (gpointer)advanced, 0);
 +		GList *query = g_list_prepend(nullptr, (gpointer) name);
 +		guint32 id = mwServiceResolve_resolve(service_resolve, query, (mwResolveFlag)(mwResolveFlag_USERS | mwResolveFlag_GROUPS), &mwResolve_handler_callback, (gpointer)advanced, nullptr);
  		g_list_free(query);
  		return id; // search handle
  	}
 @@ -744,8 +744,8 @@ int CSametimeProto::SearchForUser(const char* name, BOOLEAN advanced)  int CSametimeProto::GetMoreDetails(const char* name)
  {
  	if (m_iStatus != ID_STATUS_OFFLINE && service_resolve) {
 -		GList *query = g_list_prepend(0, (void *)name);
 -		guint32 id = mwServiceResolve_resolve(service_resolve, query, (mwResolveFlag)(mwResolveFlag_USERS | mwResolveFlag_UNIQUE), &mwResolve_handler_details_callback, NULL, 0);
 +		GList *query = g_list_prepend(nullptr, (void *)name);
 +		guint32 id = mwServiceResolve_resolve(service_resolve, query, (mwResolveFlag)(mwResolveFlag_USERS | mwResolveFlag_UNIQUE), &mwResolve_handler_details_callback, nullptr, nullptr);
  		g_list_free(query);
  		return id; // search handle
  	}
 @@ -767,7 +767,7 @@ MCONTACT CSametimeProto::AddSearchedUser(MYPROTOSEARCHRESULT* mpsr, bool tempora  	MCONTACT hContact = 0;
  	debugLogW(L"CSametimeProto::AddSearchedUser() start");
  	mwSametimeList* user_list = mwSametimeList_new();
 -	mwSametimeGroup* stgroup = 0;
 +	mwSametimeGroup* stgroup = nullptr;
  	if (mpsr->group) {
  		stgroup = mwSametimeGroup_new(user_list, mwSametimeGroup_DYNAMIC, mpsr->stid);
  		mwSametimeGroup_setAlias(stgroup, mpsr->name);
 @@ -778,7 +778,7 @@ MCONTACT CSametimeProto::AddSearchedUser(MYPROTOSEARCHRESULT* mpsr, bool tempora  		mwIdBlock uid;
  		uid.user = mpsr->stid;
 -		uid.community = 0;
 +		uid.community = nullptr;
  		mwSametimeUser *stuser = mwSametimeUser_new(stgroup, mwSametimeUser_NORMAL, &uid);
  		mwSametimeUser_setShortName(stuser, mpsr->name);
 @@ -817,13 +817,13 @@ void CSametimeProto::DeinitUserList()  	mwSession_removeService(session, mwService_AWARE);
  	mwService_free((mwService*)service_aware);
 -	service_aware = 0;
 +	service_aware = nullptr;
  	mwSession_removeService(session, mwService_RESOLVE);
  	mwService_free((mwService*)service_resolve);
 -	service_resolve = 0;
 +	service_resolve = nullptr;
  	mwSession_removeService(session, mwService_STORAGE);
  	mwService_free((mwService*)service_storage);
 -	service_storage = 0;
 +	service_storage = nullptr;
  }
 diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index 27d962a9d9..17f545cf96 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -15,7 +15,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar  	case UM_FREEPLUGINDATA:
  		PopupData* puData = (PopupData*)PUGetPluginData(hWnd);
 -		if (puData != NULL && puData != (PopupData*)CALLSERVICE_NOTFOUND) {
 +		if (puData != nullptr && puData != (PopupData*)CALLSERVICE_NOTFOUND) {
  			mir_free(puData->title);
  			mir_free(puData->text);
  			mir_free(puData);
 @@ -99,9 +99,9 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam)  	}
  	else { //disp == ED_MB
  		if (puData->flag == SAMETIME_POPUP_ERROR)
 -			MessageBox(NULL, puData->text, puData->title, MB_OK | MB_ICONWARNING);
 +			MessageBox(nullptr, puData->text, puData->title, MB_OK | MB_ICONWARNING);
  		else
 -			MessageBox(NULL, puData->text, puData->title, MB_OK | MB_ICONINFORMATION);
 +			MessageBox(nullptr, puData->text, puData->title, MB_OK | MB_ICONINFORMATION);
  	}
  	if (disp != ED_POP) {
  | 
