* Purple is the legal property of its developers, whose names are too numerous * to list here. Please refer to the COPYRIGHT file distributed with this * This program 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 program 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 program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * @section_id: libpurple-message * @short_description: serializable messages * #PurpleMessage object collects data about a certain (incoming or outgoing) message. * It (TODO: will be) serializable, so it can be stored in log and retrieved #define PURPLE_TYPE_MESSAGE purple_message_get_type() * purple_message_get_type: * Returns: the #GType for a message. G_DECLARE_FINAL_TYPE(PurpleMessage, purple_message, PURPLE, MESSAGE, GObject) * purple_message_new_outgoing: * @who: Message's recipient. * @contents: The contents of a message. * @flags: The message flags. * Creates new outgoing message (the user is the author). * You don't need to set the #PURPLE_MESSAGE_SEND flag. * Returns: the new #PurpleMessage. purple_message_new_outgoing(const gchar *who, const gchar *contents, PurpleMessageFlags flags); * purple_message_new_incoming: * @who: Message's author. * @contents: The contents of a message. * @flags: The message flags. * @timestamp: The time of transmitting a message. May be 0 for a current time. * Creates new incoming message (the user is the recipient). * You don't need to set the #PURPLE_MESSAGE_RECV flag. * Returns: the new #PurpleMessage. purple_message_new_incoming(const gchar *who, const gchar *contents, PurpleMessageFlags flags, guint64 timestamp); * purple_message_new_system: * @contents: The contents of a message. * @flags: The message flags. * Creates new system message. * You don't need to set the #PURPLE_MESSAGE_SYSTEM flag. * Returns: the new #PurpleMessage. purple_message_new_system(const gchar *contents, PurpleMessageFlags flags); * Returns the unique identifier of the message. These identifiers are not * serialized - it's a per-session id. * Returns: the global identifier of @msg. purple_message_get_id(PurpleMessage *msg); * purple_message_find_by_id: * @id: The message identifier. * Finds the message with a given @id. * Returns: (transfer none): The #PurpleMessage, or %NULL if not found. purple_message_find_by_id(guint id); * purple_message_get_author: * Returns the author of the message - his screen name (not a local alias). * Returns: the author of @msg. purple_message_get_author(PurpleMessage *msg); * purple_message_get_recipient: * Returns the recipient of the message - his screen name (not a local alias). * Returns: the recipient of @msg. purple_message_get_recipient(PurpleMessage *msg); * purple_message_set_author_alias: * Sets the alias of @msg's author. You don't normally need to call this. purple_message_set_author_alias(PurpleMessage *msg, const gchar *alias); * purple_message_get_author_alias: * Returns the alias of @msg author. * Returns: the @msg author's alias. purple_message_get_author_alias(PurpleMessage *msg); * purple_message_set_contents: * Sets the contents of the @msg. It might be HTML. purple_message_set_contents(PurpleMessage *msg, const gchar *cont); * purple_message_get_contents: * Returns the contents of the message. * Returns: the contents of @msg. purple_message_get_contents(PurpleMessage *msg); * purple_message_is_empty: * Checks, if the message's body is empty. * Returns: %TRUE, if @msg is empty. purple_message_is_empty(PurpleMessage *msg); * purple_message_set_time: * @msgtime: The timestamp of a message. * Sets the @msg's timestamp. It should be a date of posting, but it can be * a date of receiving (if the former is not available). purple_message_set_time(PurpleMessage *msg, guint64 msgtime); * purple_message_get_time: * Returns a @msg's timestamp. * Returns: @msg's timestamp. purple_message_get_time(PurpleMessage *msg); * purple_message_set_flags: * @flags: The message flags. * Sets flags for @msg. It shouldn't be in a conflict with a message type, purple_message_set_flags(PurpleMessage *msg, PurpleMessageFlags flags); * purple_message_get_flags: * Returns the flags of a @msg. * Returns: the flags of a @msg. purple_message_get_flags(PurpleMessage *msg); #endif /* PURPLE_MESSAGE_H */