summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewsAggregator/Src/Utils.cpp')
-rw-r--r--plugins/NewsAggregator/Src/Utils.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp
index fadaaa99fa..f1ae9dcec7 100644
--- a/plugins/NewsAggregator/Src/Utils.cpp
+++ b/plugins/NewsAggregator/Src/Utils.cpp
@@ -598,8 +598,20 @@ HANDLE GetContactByNick(const TCHAR *nick)
for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrW contactNick(::db_get_wsa(hContact, MODULE, "Nick"));
- if (::lstrcmpi(contactNick, nick) == 0)
+ if (!lstrcmpi(contactNick, nick))
break;
}
return hContact;
}
+
+HANDLE GetContactByURL(const TCHAR *url)
+{
+ HANDLE hContact = NULL;
+
+ for (hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ ptrW contactURL(::db_get_wsa(hContact, MODULE, "URL"));
+ if (!lstrcmpi(contactURL, url))
+ break;
+ }
+ return hContact;
+} \ No newline at end of file