diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-04 16:05:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-04 16:05:04 +0000 |
commit | a4a275e150788c7b3da197a26899a2afad393768 (patch) | |
tree | 3ea7388e3ba2a1fffe20de14a4b70c40c1e3a291 /protocols/Yahoo/util.cpp | |
parent | ab2438d317799cc265c6f392f877947c61ecd585 (diff) |
sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@298 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Yahoo/util.cpp')
-rw-r--r-- | protocols/Yahoo/util.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/protocols/Yahoo/util.cpp b/protocols/Yahoo/util.cpp index f259b12d33..197bc37497 100644 --- a/protocols/Yahoo/util.cpp +++ b/protocols/Yahoo/util.cpp @@ -182,6 +182,10 @@ int CYahooProto::GetString( HANDLE hContact, const char* name, DBVARIANT* result { return DBGetContactSettingString( hContact, m_szModuleName, name, result );
}
+int CYahooProto::GetStringUtf( HANDLE hContact, const char* name, DBVARIANT* result )
+{ return DBGetContactSettingStringUtf(hContact, m_szModuleName, name, result);
+}
+
void CYahooProto::SetString( const char* name, const char* value )
{ DBWriteContactSettingString(NULL, m_szModuleName, name, value );
}
@@ -301,33 +305,16 @@ INT_PTR __cdecl CYahooProto::OnSettingChanged(WPARAM wParam, LPARAM lParam) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- if ((HANDLE) wParam == NULL)
- return 0;
- if (!m_bLoggedIn)
+ if (!wParam || !m_bLoggedIn)
return 0;
- if (!strcmp(cws->szModule, "CList")) {
- // A temporary contact has been added permanently
- if (!strcmp(cws->szSetting, "NotOnList")) {
- if (DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0))
- return 0;
- if (cws->value.type == DBVT_DELETED || (cws->value.type == DBVT_BYTE && cws->value.bVal == 0)) {
- DBVARIANT dbv;
-
- if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )) {
- DebugLog("Adding Permanently %s to list.", dbv.pszVal);
- AddBuddy(dbv.pszVal,GetWord((HANDLE) wParam, "yprotoid", 0), "miranda", NULL);
- DBFreeVariant(&dbv);
- }
- }
- }
- }else if (!strcmp(cws->szModule, m_szModuleName) && !strcmp(cws->szSetting, "ApparentMode")) {
+ if (!strcmp(cws->szSetting, "ApparentMode")) {
DBVARIANT dbv;
DebugLog("DB Setting changed. YAHOO user's visible setting changed.");
- if ( !DBGetContactSettingString( (HANDLE) wParam, m_szModuleName, YAHOO_LOGINID, &dbv )) {
- int iAdd = (ID_STATUS_OFFLINE == DBGetContactSettingWord((HANDLE) wParam, m_szModuleName, "ApparentMode", 0));
+ if (!GetString((HANDLE)wParam, YAHOO_LOGINID, &dbv)) {
+ int iAdd = (ID_STATUS_OFFLINE == GetWord((HANDLE) wParam, "ApparentMode", 0));
stealth(dbv.pszVal, iAdd);
DBFreeVariant(&dbv);
}
|