summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-04-27 14:02:03 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-04-27 14:02:03 +0000
commit7c8a36e9dd320eb7e14da8fdb7875ff087b5d603 (patch)
tree197ab1fce765e898218fa6845411dc0df86acaaa /protocols/Skype/src/skype_events.cpp
parent81068651df147a3369a740008f326b5168cb19a6 (diff)
- some fixes in chats
- code reorganizing git-svn-id: http://svn.miranda-ng.org/main/trunk@4554 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_events.cpp')
-rw-r--r--protocols/Skype/src/skype_events.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index cc814d52e7..3ba8f1a113 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -399,15 +399,19 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa
}
else
{
- message->GetPropIdentities(data);
-
StringList alreadyInChat(this->GetChatUsers(cid));
+
+ message->GetPropIdentities(data);
StringList needToAdd(::mir_utf8decodeW(data));
- needToAdd.remove(this->login);
- for (int i = 0; i < needToAdd.getCount(); i++)
+
+ CParticipant::Refs participants;
+ conversation->GetParticipants(participants, CConversation::OTHER_CONSUMERS);
+ for (uint i = 0; i < participants.size(); i++)
{
- wchar_t *sid = needToAdd[i];
- if ( !alreadyInChat.contains(sid))
+ participants[i]->GetPropIdentity(data);
+ mir_ptr<wchar_t> sid = ::mir_utf8decodeW(data);
+
+ if (needToAdd.contains(sid) && !alreadyInChat.contains(sid))
{
CContact::Ref contact;
g_skype->GetContact((char *)mir_ptr<char>(::mir_utf8encodeW(sid)), contact);
@@ -415,11 +419,13 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa
CContact::AVAILABILITY status;
contact->GetPropAvailability(status);
- //todo: fix rank
+ CParticipant::RANK rank;
+ participants[i]->GetPropRank(rank);
+
this->AddChatContact(
cid,
sid,
- CSkypeProto::Roles[CParticipant::WRITER],
+ CSkypeProto::Roles[rank],
status);
}
}
@@ -470,11 +476,11 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa
conversation->GetPropIdentity(data);
char *cid = ::mir_strdup(data);
- /*HANDLE hContact = this->GetChatRoomByCid(cid);
- if ( !hContact || this->IsContactOnline(hContact))
+ HANDLE hContact = this->AddChatRoom(conversation);
+ if ( !this->IsContactOnline(hContact))
{
- this->JoinChat(cid);
- }*/
+ this->JoinToChat(conversation);
+ }
}
break;