Many modern protocols are using uuids as id's and forcing that into a uint64 is
going to lead to collisions. So instead just use a string which should work for
everything.
Testing Done:
Ran the demo and unit tests.
Reviewed at https://reviews.imfreedom.org/r/879/
/*
* Talkatu - GTK widgets for chat applications
* Copyright (C) 2017-2020 Gary Kramlich <grim@reaperworld.com>
*
* This library 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 library 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 library; if not, see <https://www.gnu.org/licenses/>.
*/
#include<gtk/gtk.h>
#include"talkatu/talkatumessage.h"
#include"talkatu/talkatuenums.h"
/**
* SECTION:talkatumessage
* @Title: Message
* @Short_description: A message representation
*
* Talkatu needs a way to represent a message in a client agnostic way, this is
* the API that does that.
*/
/**
* TALKATU_TYPE_MESSAGE:
*
* The standard _get_type macro for #TalkatuMessage.
*/
/**
* TalkatuMessage:
*
* #TalkatuMessage is an opaque data structure and can only be accessed using
* the following functions.
*/
/**
* TalkatuMessageInterface:
* @add_attachment: The add_attachment vfunc is called to add an attachment to
* the message.
* @remove_attachment: The remove_attachment vfunc is called to remove an
* attachment from the message.
* @get_attachment: The get_attachment vfunc gets an attachment from the
* message.
* @foreach_attachment: The foreach_attachment vfunc is called to iterate over
* each attachment in the message and call the provided
* TalkatuForeachAttachmentFunc on them.
* @clear_attachments: The clear_attachments vfunc is called to clear all
* attachments from the message.
*
* #TalkatuMessage is an interface to be implemented that standardizes the way
* messages are handled. All of its properties should be overridden with a
* sensible value returned for them.
*
* It also needs to implement a storage mechanism for attachments which are
* identified by a #guint64.
*/
/**
* TalkatuContentType:
* @TALKATU_CONTENT_TYPE_PLAIN: Plain text content.