From 985c61c624c7304783266c9f79e602f26f2887fd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Aug 2019 11:39:01 +0300 Subject: useless checks removed --- protocols/Dummy/src/dummy_proto.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'protocols/Dummy/src') 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; } -- cgit v1.2.3