summaryrefslogtreecommitdiff
path: root/protocols/Dummy/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-08-13 11:39:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-08-13 11:39:01 +0300
commit985c61c624c7304783266c9f79e602f26f2887fd (patch)
treed564daacf70417f2756137b6b86a3ee33025090e /protocols/Dummy/src
parent23f1148da6fd87d759b69d6f3865384672f78974 (diff)
useless checks removed
Diffstat (limited to 'protocols/Dummy/src')
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index 0911ce15a5..3c32087d23 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -151,23 +151,18 @@ MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
return NULL;
MCONTACT hContact = db_add_contact();
- if (hContact && Proto_AddToContact(hContact, m_szModuleName) != 0) {
- db_delete_contact(hContact);
- hContact = NULL;
- }
+ Proto_AddToContact(hContact, m_szModuleName);
- if (hContact) {
- if (flags & PALF_TEMPORARY) {
- db_set_b(hContact, "CList", "Hidden", 1);
- db_set_b(hContact, "CList", "NotOnList", 1);
- }
- else if (db_get_b(hContact, "CList", "NotOnList", 0)) {
- db_unset(hContact, "CList", "Hidden");
- db_unset(hContact, "CList", "NotOnList");
- }
- setWString(hContact, uniqueIdSetting, psr->id.w);
- setWString(hContact, "Nick", psr->id.w);
+ if (flags & PALF_TEMPORARY) {
+ db_set_b(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ }
+ else if (db_get_b(hContact, "CList", "NotOnList", 0)) {
+ db_unset(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "NotOnList");
}
+ setWString(hContact, uniqueIdSetting, psr->id.w);
+ setWString(hContact, "Nick", psr->id.w);
return hContact;
}