Done until djumbai-send
This commit is contained in:
parent
83bd6fb796
commit
da345fc422
8 changed files with 135 additions and 36 deletions
|
@ -1,11 +1,12 @@
|
|||
#include "protocol.h"
|
||||
|
||||
int new_message(message *m, unsigned int sender, unsigned int receiver, char *content) {
|
||||
int new_message(message *m, unsigned int sender, unsigned int isgroup, unsigned int receiver, char *content) {
|
||||
if (strlen(content) > MAX_CONTENT_SIZE) {
|
||||
return 1;
|
||||
}
|
||||
m->header.version = VERSION;
|
||||
m->header.sender = sender;
|
||||
m->header.isgroup = isgroup;
|
||||
m->header.receiver = receiver;
|
||||
time(&m->header.timestamp);
|
||||
strncpy(m->content, content, MAX_CONTENT_SIZE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue