diff options
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -7,6 +7,7 @@ #include "broadcast.h" #include "command.h" #include "db.h" +#include "event.h" #include "net.h" #include "user_data.h" #include "util.h" @@ -160,6 +161,8 @@ static bool cmd_invite(struct conn_data *data,const char *tag,const char **args) char *invitebuf=NULL; i64 invitebuflen=asprintf(&invitebuf,"_push invite %s\n",roomname); + event_emit_join(make_timestamp(),username,roomname); + struct db_user_list members=db_list_members(roomid); for(i64 i=0;i<members.count;i++){ i64 nfds; @@ -208,6 +211,8 @@ static bool cmd_send(struct conn_data *data,const char *tag,const char **args){ char *username=db_get_username(data->userid); i64 pushbuflen=asprintf(&pushbuf,"_push message %s %s %" PRIi64 " %s\n", roomname,username,timestamp,message); + + event_emit_message(timestamp,message,username,roomname); free(username); struct db_user_list members=db_list_members(roomid); |