summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-03-05 10:31:09 +0100
committerRobert Pösel <robyer@seznam.cz>2017-03-05 10:31:09 +0100
commit6d73ad7a3f52826bbbb6c79fef2f3c70447d152e (patch)
treeef01b8cf349ff857009059a8496d325b6a6d84c6 /protocols/FacebookRM/src
parentcc8f9defc89f3c56088ac8de2e979938a0e85947 (diff)
Facebook: Remove forgotten useless optimizations
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/json.cpp39
1 files changed, 14 insertions, 25 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 6325c2cca2..3128721e3f 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -812,25 +812,21 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
else if (p == 2)
status = ID_STATUS_ONLINE;
- if (proto->getWord(hContact, "Status", 0) != status)
- proto->setWord(hContact, "Status", status);
+ proto->setWord(hContact, "Status", status);
}
// Last active time
if (lat_) {
time_t last_active = utils::time::from_string(lat_.as_string());
- if (proto->getDword(hContact, "LastActiveTS", 0) != last_active) {
- if (last_active > 0)
- proto->setDword(hContact, "LastActiveTS", last_active);
- else
- proto->delSetting(hContact, "LastActiveTS");
- }
+ if (last_active > 0)
+ proto->setDword(hContact, "LastActiveTS", last_active);
+ else
+ proto->delSetting(hContact, "LastActiveTS");
// Set users inactive for too long as offline
if (last_active > 0 && last_active < offlineThreshold) {
- if (proto->getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE)
- proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
+ proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
}
@@ -851,10 +847,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
else {
client = FACEBOOK_CLIENT_OTHER;
}
-
- ptrW oldClient(proto->getWStringA(hContact, "MirVer"));
- if (!oldClient || mir_wstrcmp(oldClient, client))
- proto->setWString(hContact, "MirVer", client);
+ proto->setWString(hContact, "MirVer", client);
}
}
}
@@ -934,12 +927,11 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
// proto->delSetting(hContact, "IdleTS");
//}
- /*if (proto->getDword(hContact, "LastActiveTS", 0) != last_active) {
- if (last_active > 0)
- proto->setDword(hContact, "LastActiveTS", last_active);
- else
- proto->delSetting(hContact, "LastActiveTS");
- }*/
+ /*if (last_active > 0)
+ proto->setDword(hContact, "LastActiveTS", last_active);
+ else
+ proto->delSetting(hContact, "LastActiveTS");
+ */
// Set users inactive for too long as offline
if (last_active > 0 && last_active < offlineThreshold)
@@ -949,8 +941,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
proto->delSetting(hContact, "IdleTS");
}
- if (proto->getWord(hContact, "Status", 0) != status)
- proto->setWord(hContact, "Status", status);
+ proto->setWord(hContact, "Status", status);
if (s_) {
// what to do with this?
@@ -974,9 +965,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
client = FACEBOOK_CLIENT_OTHER;
}*/
- ptrW oldClient(proto->getWStringA(hContact, "MirVer"));
- if (!oldClient || mir_wstrcmp(oldClient, client))
- proto->setWString(hContact, "MirVer", client);
+ proto->setWString(hContact, "MirVer", client);
}
}
} else if (t == "ticker_update:home") {