diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-04-20 10:14:05 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-04-20 10:14:05 +0000 |
commit | 5560fccb85a89bb668a79eed3d4cd0e668278331 (patch) | |
tree | a8c5949d9cc473c51af2712bb79c306f4a531932 /protocols/Skype/src/skype_proto.cpp | |
parent | 5a5ffa5cc195669c48827e4cf9d948dfb3272e47 (diff) |
- temporary commit. may contain non-working code
git-svn-id: http://svn.miranda-ng.org/main/trunk@4480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index c418556ef4..1571db1c0f 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -35,13 +35,16 @@ CSkypeProto::~CSkypeProto() this->password = NULL;
}
- ProtoDestructor(this);
+ ::ProtoDestructor(this);
}
HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- //todo:ref
- return this->AddContactBySid(::mir_u2a(psr->id), ::mir_u2a(psr->nick), 0);
+ //fixme
+ CContact::Ref contact;
+ this->skype->GetContact(::mir_u2a(psr->id), contact);
+ return this->AddContact(contact);
+ return 0;
}
HANDLE __cdecl CSkypeProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
@@ -325,24 +328,20 @@ HANDLE __cdecl CSkypeProto::SendFile( HANDLE hContact, const TCHAR* szDescriptio int __cdecl CSkypeProto::SendMsg(HANDLE hContact, int flags, const char* msg)
{
- int result = ::InterlockedIncrement((LONG volatile*)&dwCMDNum);
-
CConversation::Ref conversation = CConversation::FindBySid(
this->skype,
- ::db_get_sa(hContact, this->m_szModuleName, "sid"));
+ (char*)::mir_ptr<char>(::db_get_sa(hContact, this->m_szModuleName, "sid")));
+
if (conversation)
{
- Message::Ref message;
- conversation->PostText(msg, message);
- }
+ CMessage::Ref message;
+ if (!conversation->PostText(msg, message))
+ return 0;
- this->SendBroadcastAsync(
- hContact,
- ACKTYPE_MESSAGE,
- ACKRESULT_SUCCESS,
- (HANDLE)result, 0);
+ return message->getOID();
+ }
- return result;
+ return 0;
}
int __cdecl CSkypeProto::SendUrl( HANDLE hContact, int flags, const char* url ) { return 0; }
|