aboutsummaryrefslogtreecommitdiff
path: root/event.c
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-09-29 22:18:33 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-09-29 22:25:23 +0200
commita8a0603375fa4c5c1e61bd8a0dc0ed7f3f77854e (patch)
treec1749d16c7fe8fad8b0d04cc80092cd22c180a9d /event.c
parent1ecfdb8eef2e1cf5c9f017708b6313ea5d4093d7 (diff)
server: Implement room_leave
Diffstat (limited to 'event.c')
-rw-r--r--event.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/event.c b/event.c
index e85eb45..20591a3 100644
--- a/event.c
+++ b/event.c
@@ -98,3 +98,13 @@ void event_emit_join(i64 timestamp,const char *user,const char *room){
event_emit(event);
event_item_free(event);
}
+
+void event_emit_leave(i64 timestamp,const char *user,const char *room){
+ struct event_item *event=event_item_alloc();
+ event->type=EVENT_LEAVE;
+ event->timestamp=timestamp;
+ event->user=strdup(user);
+ event->room=strdup(room);
+ event_emit(event);
+ event_item_free(event);
+}