aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-event.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2016-09-01 00:22:44 +0100
committerDr. David Alan Gilbert <dave@treblig.org>2016-09-03 00:05:09 +0100
commit3857950b0b8c0310f1608d391db47d2e9f592e1a (patch)
treef7783cdc891de6429d8c2ec8f4bf719a2e4dec56 /matrix-event.c
parent511fa3c1e886fd968c6e29fcafd80f840b0b6f51 (diff)
downloadpurple-matrix-3857950b0b8c0310f1608d391db47d2e9f592e1a.tar.gz
event hooks
Some events need to do something else before the event can be transmitted, and indeed the contents of the event aren't necessarily known until that other thing has happened. Add a hook that gets called when the event is ready to be sent and when the event is to be free'd. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Diffstat (limited to 'matrix-event.c')
-rw-r--r--matrix-event.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/matrix-event.c b/matrix-event.c
index 3f1b714..3413474 100644
--- a/matrix-event.c
+++ b/matrix-event.c
@@ -50,5 +50,8 @@ void matrix_event_free(MatrixRoomEvent *event)
g_free(event->txn_id);
g_free(event->sender);
g_free(event->event_type);
+ if (event->hook) {
+ event->hook(event, TRUE);
+ }
g_free(event);
}