client send done?
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "client.h"
|
||||
|
||||
int send_message(unsigned int sender, unsigned int receiver) {
|
||||
int send_message(unsigned int receiver,int isgroup) {
|
||||
int sender = getuid();
|
||||
int pipe_to_child[2];
|
||||
|
||||
if (pipe(pipe_to_child) == -1) {
|
||||
@@ -34,7 +35,7 @@ int send_message(unsigned int sender, unsigned int receiver) {
|
||||
fgets(content, MAX_CONTENT_SIZE, stdin);
|
||||
|
||||
message msg;
|
||||
if (new_message(&msg, sender, 0, receiver, content) != 0) {
|
||||
if (new_message(&msg, sender, isgroup, receiver, content) != 0) {
|
||||
printf("Error when creating new message\n");
|
||||
}
|
||||
|
||||
@@ -105,19 +106,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (groupFlag) {
|
||||
if (syncFlag) {
|
||||
// send to group synchronously
|
||||
} else {
|
||||
// send to group asynchronously
|
||||
}
|
||||
} else {
|
||||
if (syncFlag) {
|
||||
// send to user synchronously
|
||||
} else {
|
||||
// send to user asynchronously
|
||||
}
|
||||
}
|
||||
int receiverUidInt = atoi(receiverUid);
|
||||
|
||||
send_message(receiverUidInt,groupFlag);
|
||||
|
||||
// unsigned int sender = getuid();
|
||||
// unsigned int receiver = 1000;
|
||||
|
||||
Reference in New Issue
Block a user