summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-07 16:29:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-07 16:29:17 +0000
commit59de222d916876cc158d03909b661dd8b2cf6a3f (patch)
tree0eeffe666cfd2a5e151edacf26237cddab74d264 /protocols/VKontakte/src/misc.cpp
parentae6d0b3c9f732c3770fc4bf00ba2e52012671108 (diff)
- frient list & statuses;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@6396 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index a59a4a16b4..6470a303ad 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -38,6 +38,27 @@ void CVkProto::SetAllContactStatuses(int iStatus)
}
}
+HANDLE CVkProto::FindUser(LPCSTR pUserid, bool bCreate)
+{
+ for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
+ ptrA dbUserid(getStringA(hContact, "ID"));
+ if (dbUserid == NULL)
+ continue;
+
+ if ( !strcmp(dbUserid, pUserid))
+ return hContact;
+ }
+
+ if (!bCreate)
+ return NULL;
+
+ HANDLE hNewContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hNewContact, (LPARAM)m_szModuleName);
+ setString(hNewContact, "ID", pUserid);
+ db_set_ts(hNewContact, "CList", "Group", m_defaultGroup);
+ return hNewContact;
+}
+
int CVkProto::SetServerStatus(int iStatus)
{
return 0;