summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MySpace/proto.cpp2
-rw-r--r--MySpace/server_con.cpp22
-rw-r--r--MySpace/server_con.h2
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);