From 1f6d928c10d931beadb241358ef4cb1830165f56 Mon Sep 17 00:00:00 2001 From: sje Date: Sun, 1 Jul 2007 03:31:49 +0000 Subject: another fix for packet reading :| git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@226 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/proto.cpp | 2 +- MySpace/server_con.cpp | 22 ++++++++++++---------- MySpace/server_con.h | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/MySpace/proto.cpp b/MySpace/proto.cpp index 0b6cf6d..b2f03d9 100644 --- a/MySpace/proto.cpp +++ b/MySpace/proto.cpp @@ -292,7 +292,7 @@ int AddToList(WPARAM wParam, LPARAM lParam) { HANDLE hContact = FindContact(mpsr->uid); if(!hContact) { - hContact = CreateContact(mpsr->uid, mpsr->psr.nick, mpsr->psr.email); + hContact = CreateContact(mpsr->uid, mpsr->psr.nick, mpsr->psr.email, true); } if(temp) { diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp index a98a8f0..35e7da1 100644 --- a/MySpace/server_con.cpp +++ b/MySpace/server_con.cpp @@ -86,7 +86,7 @@ int LookupUID(int uid) { return ret; } -HANDLE CreateContact(int uid, char *nick, char *email) { +HANDLE CreateContact(int uid, char *nick, char *email, bool add_buddy) { HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0); if(hContact) { @@ -99,13 +99,15 @@ HANDLE CreateContact(int uid, char *nick, char *email) { } - ClientNetMessage msg_add; - msg_add.add_string("addbuddy", ""); - msg_add.add_int("sesskey", sesskey); - msg_add.add_int("newprofileid", uid); - msg_add.add_string("reason", ""); + if(add_buddy) { + ClientNetMessage msg_add; + msg_add.add_string("addbuddy", ""); + msg_add.add_int("sesskey", sesskey); + msg_add.add_int("newprofileid", uid); + msg_add.add_string("reason", ""); - SendMessage(msg_add); + SendMessage(msg_add); + } /* ClientNetMessage msg_block; @@ -379,7 +381,7 @@ void __cdecl ServerThreadFunc(void*) { if(uid) { HANDLE hContact = FindContact(uid); if(!hContact) { - hContact = CreateContact(uid, 0, 0); + hContact = CreateContact(uid, 0, 0, false); LookupUID(uid); } char smsg[1024]; @@ -392,7 +394,7 @@ void __cdecl ServerThreadFunc(void*) { if(uid) { HANDLE hContact = FindContact(uid); if(!hContact) { - hContact = CreateContact(uid, 0, 0); + hContact = CreateContact(uid, 0, 0, true); LookupUID(uid); } char text[MAX_MESSAGE_SIZE]; @@ -500,7 +502,7 @@ void __cdecl ServerThreadFunc(void*) { } } } - pbuff = end; + pbuff = end + 1; } } } diff --git a/MySpace/server_con.h b/MySpace/server_con.h index e6856b6..5d100c4 100644 --- a/MySpace/server_con.h +++ b/MySpace/server_con.h @@ -13,7 +13,7 @@ extern int my_uid; void SetServerStatus(int st); HANDLE FindContact(int uid); -HANDLE CreateContact(int uid, char *nick, char *email); +HANDLE CreateContact(int uid, char *nick, char *email, bool add_buddy); int LookupUID(int uid); void SendMessage(ClientNetMessage &msg); -- cgit v1.2.3