/*
 * Purple Zulip - Zulip Protocol Plugin
 * Copyright (C) Pidgin Developers <devel@pidgin.im>
 *
 * Purple Zulip is the legal property of its developers, whose names are too
 * numerous to list here. Please refer to the COPYRIGHT file distributed with
 * this source distribution.
 *
 * This plugin is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * This plugin is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this plugin; if not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PURPLE_ZULIP_EVENTS_H
#define PURPLE_ZULIP_EVENTS_H

#include <glib.h>
#include <glib-object.h>

#include "purplezuliptypes.h"

G_BEGIN_DECLS

/* Some constants for the names of the events. */
#define PURPLE_ZULIP_EVENT_HEARTBEAT "heartbeat"
#define PURPLE_ZULIP_EVENT_MESSAGE "message"

/* Event is a base Zulip event, used by GET /api/v1/events and maybe others. */
typedef struct {
	/* Basic event fields. */
	char *type;
	/* GList *flags; */
	int id;

	/* Type specific fields. */
	PurpleZulipMessage *message;
} PurpleZulipEvent;

#define PURPLE_ZULIP_TYPE_EVENT (purple_zulip_event_get_type())

G_GNUC_INTERNAL PurpleZulipEvent *purple_zulip_event_copy(PurpleZulipEvent *event);
G_GNUC_INTERNAL void purple_zulip_event_free(PurpleZulipEvent *event);
G_GNUC_INTERNAL GType purple_zulip_event_get_type(void);

G_END_DECLS

#endif /* PURPLE_ZULIP_EVENTS_H */
