summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-25 20:36:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-25 20:36:15 +0300
commit1ca493fc7af16dd20ad13453fc19774da3c65181 (patch)
tree2266e08cac1826ce348d9e151a5c48c5a08eba64 /protocols/IcqOscarJ
parentddb2be6e2d260554268db4d4744b38ac00697289 (diff)
fixes #1117 (Empty messages on restart seen by official ICQ client on iOS)
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/fam_01service.cpp3
-rw-r--r--protocols/IcqOscarJ/src/fam_15icqserver.cpp17
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp20
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h1
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp24
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp38
-rw-r--r--protocols/IcqOscarJ/src/version.h6
7 files changed, 4 insertions, 105 deletions
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp
index 04a7f18e06..ad6ff78bd3 100644
--- a/protocols/IcqOscarJ/src/fam_01service.cpp
+++ b/protocols/IcqOscarJ/src/fam_01service.cpp
@@ -712,9 +712,6 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info)
else
szMoodData[0] = '\0';
- //! Tricky code, this ensures that the status note will be saved to the directory
- SetStatusNote(szStatusNote, m_bGatewayMode ? 5000 : 2500, TRUE);
-
size_t wStatusNoteLen = mir_strlen(szStatusNote);
size_t wStatusMoodLen = mir_strlen(szMoodData);
size_t wSessionDataLen = (wStatusNoteLen ? wStatusNoteLen + 4 : 0) + 4 + wStatusMoodLen + 4;
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
index 3a58297543..0bce60710f 100644
--- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp
+++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
@@ -857,23 +857,6 @@ void CIcqProto::parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain
writeDbInfoSettingTLVStringUtf(hContact, "About", cDetails, 0x186);
- // if (hContact)
- // writeDbInfoSettingTLVStringUtf(hContact, DBSETTING_STATUS_NOTE, cDetails, 0x226);
- // else
- if (!hContact) { // Owner contact needs special processing, in the database is current status note for the client
- // We just received the last status note set on directory, if it differs call SetStatusNote() to
- // ensure the directory will be updated (it should be in process anyway)
- char *szClientStatusNote = getSettingStringUtf(hContact, DBSETTING_STATUS_NOTE, nullptr);
- char *szDirectoryStatusNote = cDetails->getString(0x226, 1);
-
- if (mir_strcmp(szClientStatusNote, szDirectoryStatusNote))
- SetStatusNote(szClientStatusNote, 1000, TRUE);
-
- // Release memory
- SAFE_FREE(&szDirectoryStatusNote);
- SAFE_FREE(&szClientStatusNote);
- }
-
writeDbInfoSettingTLVByte(hContact, "PrivacyLevel", cDetails, 0x1F9);
if (!hContact) {
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index fcaa00b512..fb9a2928d6 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -1505,12 +1505,6 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
// New status is OFFLINE
if (nNewStatus == ID_STATUS_OFFLINE) { // for quick logoff
- if (icqOnline()) { // set offline status note (otherwise the old will remain)
- char *szOfflineNote = PrepareStatusNote(nNewStatus);
- SetStatusNote(szOfflineNote, 0, FALSE);
- SAFE_FREE(&szOfflineNote);
- }
-
m_iDesiredStatus = nNewStatus;
if (hServerConn) { // Connected, Send disconnect packet
@@ -1563,11 +1557,6 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
char *szStatusNote = PrepareStatusNote(nNewStatus);
- //! This is a bit tricky, we do trigger status note change thread and then
- // change the status note right away (this spares one packet) - so SetStatusNote()
- // will only change User Details Directory
- SetStatusNote(szStatusNote, 6000, FALSE);
-
if (m_iStatus == ID_STATUS_INVISIBLE) {
if (m_bSsiEnabled)
updateServVisibilityCode(3);
@@ -1741,15 +1730,8 @@ int __cdecl CIcqProto::SetAwayMsg(int status, const wchar_t* msg)
*ppszMsg = szNewUtf;
szNewUtf = nullptr;
- if ((m_iStatus == status) && icqOnline()) { // update current status note
- char *szNote = *ppszMsg ? *ppszMsg : "";
-
- BYTE bXStatus = getContactXStatus(NULL);
- if (!bXStatus)
- SetStatusNote(szNote, 1000, FALSE);
-
+ if ((m_iStatus == status) && icqOnline()) // update current status note
icq_sendSetAimAwayMsgServ(*ppszMsg);
- }
}
SAFE_FREE(&szNewUtf);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 1fb9158f32..1c46ce3b3b 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -887,7 +887,6 @@ struct CIcqProto : public PROTO<CIcqProto>
char *setStatusNoteText, *setStatusMoodData;
void __cdecl SetStatusNoteThread(void *pArguments);
- int SetStatusNote(const char *szStatusNote, DWORD dwDelay, int bForced);
int SetStatusMood(const char *szMoodData, DWORD dwDelay);
void writeDbInfoSettingTLVStringUtf(MCONTACT hContact, const char *szSetting, oscar_tlv_chain *chain, WORD wTlv);
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 0a98def4bf..a06b0a1241 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -519,30 +519,6 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate)
SetStatusMood(szMoodData, 1500);
}
-
- char *szStatusNote = nullptr;
-
- // use custom status message as status note
- if (bXStatus && (m_bXStatusEnabled || m_bMoodsEnabled))
- szStatusNote = getSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, "");
- // retrieve standard status message (e.g. custom status set to none)
- else {
- char **pszMsg = MirandaStatusToAwayMsg(m_iStatus);
- {
- mir_cslock l(m_modeMsgsMutex);
- if (pszMsg)
- szStatusNote = null_strdup(*pszMsg);
- }
-
- // no default status message, set empty
- if (!szStatusNote)
- szStatusNote = null_strdup("");
- }
-
- if (szStatusNote)
- SetStatusNote(szStatusNote, 1500, FALSE);
-
- SAFE_FREE(&szStatusNote);
}
static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 1dee50ae14..1a22839013 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -1099,44 +1099,6 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
}
-int CIcqProto::SetStatusNote(const char *szStatusNote, DWORD dwDelay, int bForce)
-{
- int bChanged = FALSE;
-
- // bForce is intended for login sequence - need to call this earlier than icqOnline()
- // the process is delayed and icqOnline() is ready when needed inside SetStatusNoteThread()
- if (!bForce && !icqOnline()) return bChanged;
-
- // reuse generic critical section (used for cookies list and object variables locks)
- mir_cslock l(cookieMutex);
-
- if (!setStatusNoteText && (!m_bMoodsEnabled || !setStatusMoodData)) { // check if the status note was changed and if yes, create thread to change it
- char *szCurrentStatusNote = getSettingStringUtf(NULL, DBSETTING_STATUS_NOTE, nullptr);
-
- if (mir_strcmp(szCurrentStatusNote, szStatusNote)) { // status note was changed
- // create thread to change status note on existing server connection
- setStatusNoteText = null_strdup(szStatusNote);
-
- if (dwDelay)
- ForkThread(&CIcqProto::SetStatusNoteThread, (void*)dwDelay);
- else // we cannot afford any delay, so do not run in separate thread
- SetStatusNoteThread(nullptr);
-
- bChanged = TRUE;
- }
- SAFE_FREE(&szCurrentStatusNote);
- }
- else { // only alter status note object with new status note, keep the thread waiting for execution
- SAFE_FREE(&setStatusNoteText);
- setStatusNoteText = null_strdup(szStatusNote);
-
- bChanged = TRUE;
- }
-
- return bChanged;
-}
-
-
int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay)
{
int bChanged = FALSE;
diff --git a/protocols/IcqOscarJ/src/version.h b/protocols/IcqOscarJ/src/version.h
index 4e7f36327b..253becb75d 100644
--- a/protocols/IcqOscarJ/src/version.h
+++ b/protocols/IcqOscarJ/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 11
-#define __RELEASE_NUM 3
-#define __BUILD_NUM 6
+#define __MINOR_VERSION 95
+#define __RELEASE_NUM 8
+#define __BUILD_NUM 1
#include <stdver.h>