diff options
Diffstat (limited to 'protocols/Dummy/src')
-rw-r--r-- | protocols/Dummy/src/dummy_proto.cpp | 25 |
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; } |