+ if (flags & CHECK_MOODS) {
+ ret = send_callback_request(mood_check_callback, NULL,
+ afs_cb_result_handler, cc);
+ if (ret < 0)
+ return ret;
+ }
+ return 1;
+}
+
+/**
+ * The afs event dispatcher.
+ *
+ * \param event Type of the event.
+ * \param pb May be \p NULL.
+ * \param data Type depends on \a event.
+ *
+ * This function calls the table handlers of all tables and passes \a pb and \a
+ * data verbatim. It's up to the handlers to interpret the \a data pointer.
+ */
+void afs_event(enum afs_events event, struct para_buffer *pb,
+ void *data)
+{
+ int i, ret;
+
+ for (i = 0; i < NUM_AFS_TABLES; i++) {
+ struct afs_table *t = &afs_tables[i];
+ if (!t->event_handler)
+ continue;
+ ret = t->event_handler(event, pb, data);
+ if (ret < 0)
+ PARA_CRIT_LOG("table %s, event %d: %s\n", t->name,
+ event, para_strerror(-ret));
+ }
+}
+
+/**
+ * Dummy event handler for the images table.
+ *
+ * \param event Unused.
+ * \param pb Unused.
+ * \param data Unused.
+ *
+ * \return The images table does not honor events, so this handler always
+ * returns success.
+ */
+__a_const int images_event_handler(__a_unused enum afs_events event,
+ __a_unused struct para_buffer *pb, __a_unused void *data)
+{
+ return 1;
+}
+
+/**
+ * Dummy event handler for the lyrics table.
+ *
+ * \param event Unused.
+ * \param pb Unused.
+ * \param data Unused.
+ *
+ * \return The lyrics table does not honor events, so this handler always
+ * returns success.
+ */
+__a_const int lyrics_event_handler(__a_unused enum afs_events event,
+ __a_unused struct para_buffer *pb, __a_unused void *data)
+{