summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp10
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp3
-rw-r--r--src/mir_app/src/mdatabasecache.cpp6
4 files changed, 15 insertions, 6 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index 4e444eaa67..76122610f9 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -770,9 +770,15 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteContactSetting(MCONTACT contactID, LPCSTR sz
}
DBMoveChunk(ofsSettingToCut, ofsSettingToCut + nameLen + valLen, ofsBlobPtr + 1 - ofsSettingToCut);
DBFlush(1);
- }
- m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1);
+ // remove a value from cache anyway
+ m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1);
+ }
+ else { // resident variable
+ // if a value doesn't exist, simply return error
+ if (m_cache->GetCachedValuePtr(saveContact, szCachedSettingName, -1) == NULL)
+ return 1;
+ }
}
// notify
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 2fadd3420b..078dafc057 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -455,8 +455,6 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact)
ResetAdvStatus(hContact, ADVSTATUS_MOOD);
ResetAdvStatus(hContact, ADVSTATUS_TUNE);
-
- //JabberUpdateContactExtraIcon(hContact);
}
void CJabberProto::InitPopups(void)
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index bf467a484b..b9d3223dda 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -136,6 +136,9 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
m_pepServices.insert(new CPepMood(this));
m_pepServices.insert(new CPepActivity(this));
+ db_set_resident(m_szModuleName, DBSETTING_XSTATUSID);
+ db_set_resident(m_szModuleName, DBSETTING_XSTATUSNAME);
+ db_set_resident(m_szModuleName, DBSETTING_XSTATUSMSG);
db_set_resident(m_szModuleName, DBSETTING_DISPLAY_UID);
db_set_resident(m_szModuleName, "SubscriptionText");
db_set_resident(m_szModuleName, "Subscription");
diff --git a/src/mir_app/src/mdatabasecache.cpp b/src/mir_app/src/mdatabasecache.cpp
index 82c5a54ef8..bddeecb750 100644
--- a/src/mir_app/src/mdatabasecache.cpp
+++ b/src/mir_app/src/mdatabasecache.cpp
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "database.h"
+static DBVARIANT temp;
+
static int stringCompare(const char *p1, const char *p2)
{
return mir_strcmp(p1, p2);
@@ -185,7 +187,7 @@ STDMETHODIMP_(DBVARIANT*) MDatabaseCache::GetCachedValuePtr(MCONTACT contactID,
FreeCachedVariant(&V->value);
m_lGlobalSettings.remove(index);
HeapFree(m_hCacheHeap, 0, V);
- return NULL;
+ return &temp; // not null - smth were deleted
}
}
else {
@@ -245,7 +247,7 @@ STDMETHODIMP_(DBVARIANT*) MDatabaseCache::GetCachedValuePtr(MCONTACT contactID,
break;
}
HeapFree(m_hCacheHeap, 0, V);
- return NULL;
+ return &temp; // not null - smth were deleted
}
return &V->value;