summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-04-06 18:55:34 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-04-06 18:55:34 +0000
commitdea767bfe91ba408b09e4f9bcd503dd2150276a7 (patch)
treed44ac7a5e0460144feee1c2996dac5a1d02e67f5 /protocols/Steam/src/steam_contacts.cpp
parent8457a7c95db2775bd977ba8de5091f5d5d9277eb (diff)
Steam: server polling, status changing, messaging
git-svn-id: http://svn.miranda-ng.org/main/trunk@8873 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_contacts.cpp')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index ab95bf4649..9e01da2e33 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -1,5 +1,23 @@
#include "common.h"
+void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status)
+{
+ WORD oldStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
+ if (oldStatus != status)
+ setWord(hContact, "Status", status);
+}
+
+void CSteamProto::SetAllContactsStatus(WORD status)
+{
+ for (MCONTACT hContact = db_find_first(this->m_szModuleName); hContact; hContact = db_find_next(hContact, this->m_szModuleName))
+ {
+ if (this->isChatRoom(hContact))
+ continue;
+ //if (this->IsContactOnline(hContact))
+ setWord(hContact, "Status", status);
+ }
+}
+
MCONTACT CSteamProto::FindContact(const char *steamId)
{
MCONTACT hContact = NULL;
@@ -26,10 +44,11 @@ MCONTACT CSteamProto::AddContact(const SteamWebApi::FriendApi::Friend &contact)
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)this->m_szModuleName);
- this->setString(hContact, "SteamID", contact.GetSteamId());
- this->setWString(hContact, "Nick", contact.GetNickname());
- this->setString(hContact, "Homepage", contact.GetHomepage());
- this->setDword(hContact, "LastEventDateTS", contact.GetLastEvent());
+ setString(hContact, "SteamID", contact.GetSteamId());
+ setWString(hContact, "Nick", contact.GetNickname());
+ setString(hContact, "Homepage", contact.GetHomepage());
+ setDword(hContact, "LastEventDateTS", contact.GetLastEvent());
+ db_set_ws(hContact, "CList", "MyHandle", contact.GetNickname());
DBVARIANT dbv;
if (!getWString("DefaultGroup", &dbv))