summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Mra_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-08 20:01:45 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-08 20:01:45 +0000
commitb3ac2b8aa5e0357325d6a8c31869cfac31424c43 (patch)
treee8025f1045a59bada4edafd26a38d697a5fc3553 /protocols/MRA/src/Mra_proto.cpp
parentf90c2d591aec8d0f7c4c41b420a3e1b54fc082de (diff)
- group processing moved after contact's addition
- fixed misprint in variable name (it's resident anyway) git-svn-id: http://svn.miranda-ng.org/main/trunk@6026 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra_proto.cpp')
-rw-r--r--protocols/MRA/src/Mra_proto.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index 4a6aa1952e..9af85b3299 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -612,13 +612,13 @@ bool CMraProto::CmdAuthAck(BinBuffer &buf)
db_event_add(0, &dbei);
}
- DWORD dwTemp;
- GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwTemp, NULL, NULL, NULL, NULL);
- dwTemp &= ~CONTACT_INTFLAG_NOT_AUTHORIZED;
- SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, SCBIF_SERVER_FLAG, 0, 0, 0, dwTemp, 0, 0, 0, 0);
- setDword(hContact, "HooksLocked", TRUE);
+ DWORD dwFlags = getDword(hContact, "ContactServerFlags", 0);
+ if (dwFlags & CONTACT_INTFLAG_NOT_AUTHORIZED) {
+ dwFlags &= ~CONTACT_INTFLAG_NOT_AUTHORIZED;
+ setDword(hContact, "ContactServerFlags", dwFlags);
+ }
+
db_unset(hContact, "CList", "NotOnList");
- setDword(hContact, "HooksLocked", FALSE);
return true;
}
@@ -752,8 +752,15 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf)
DWORD dwTemp = buf.getDword();
switch (dwTemp) {
case CONTACT_OPER_SUCCESS:// ## добавление произведено успешно
- if (cmd == MRIM_CS_ADD_CONTACT_ACK)
- SetContactBasicInfoW(hContact, 0, (SCBIF_ID|SCBIF_SERVER_FLAG), buf.getDword(), 0, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, 0, 0, 0);
+ if (cmd == MRIM_CS_ADD_CONTACT_ACK) {
+ DWORD dwFlags = SCBIF_ID | SCBIF_SERVER_FLAG, dwGroupID = 0;
+ ptrT grpName( db_get_tsa(hContact, "CList", "Group"));
+ if (grpName) {
+ dwFlags |= SCBIF_GROUP_ID;
+ dwGroupID = MraMoveContactToGroup(hContact, -1, grpName);
+ }
+ SetContactBasicInfoW(hContact, 0, dwFlags, buf.getDword(), dwGroupID, 0, CONTACT_INTFLAG_NOT_AUTHORIZED, 0, 0, 0, 0);
+ }
break;
case CONTACT_OPER_ERROR:// ## переданные данные были некорректны
ShowFormattedErrorMessage(L"Data been sent are invalid", NO_ERROR);
@@ -1316,7 +1323,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf)
// request user info from server
MraUpdateContactInfo(hContact);
}
- else { //****deb - check group ID param
+ else {
if (iGroupMode == 100) { // first start
ptrT tszGroup( db_get_tsa(hContact, "CList", "Group"));
if (tszGroup)