GNUnet  0.19.4
messenger_api_room.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2020--2021 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
26 #ifndef GNUNET_MESSENGER_API_ROOM_H
27 #define GNUNET_MESSENGER_API_ROOM_H
28 
29 #include "platform.h"
30 #include "gnunet_util_lib.h"
31 
33 
35 #include "messenger_api_contact.h"
36 #include "messenger_api_message.h"
37 
41 };
42 
44 {
46  struct GNUNET_HashCode key;
47 
48  int opened;
49 
51 
53 
56 };
57 
67  const struct GNUNET_HashCode *key);
68 
74 void
75 destroy_room (struct GNUNET_MESSENGER_Room *room);
76 
85 const struct GNUNET_MESSENGER_Message*
86 get_room_message (const struct GNUNET_MESSENGER_Room *room,
87  const struct GNUNET_HashCode *hash);
88 
98 get_room_sender (const struct GNUNET_MESSENGER_Room *room,
99  const struct GNUNET_HashCode *hash);
100 
116  struct GNUNET_MESSENGER_Contact *sender,
117  const struct GNUNET_MESSENGER_Message *message,
118  const struct GNUNET_HashCode *hash);
119 
129 int
132  void* cls);
133 
142 int
143 find_room_member (const struct GNUNET_MESSENGER_Room *room,
144  const struct GNUNET_MESSENGER_Contact *contact);
145 
146 #endif //GNUNET_MESSENGER_API_ROOM_H
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
int(* GNUNET_MESSENGER_MemberCallback)(void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
Method called for each member in a room during iteration.
messenger api: client implementation of GNUnet MESSENGER service
messenger api: client and service implementation of GNUnet MESSENGER service
messenger api: client and service implementation of GNUnet MESSENGER service
struct GNUNET_MESSENGER_Contact * handle_room_message(struct GNUNET_MESSENGER_Room *room, struct GNUNET_MESSENGER_Contact *sender, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
Handles a message with a given hash in a room for the client API to update members and its informatio...
struct GNUNET_MESSENGER_Contact * get_room_sender(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a messages sender locally stored from a map for a given hash in a room.
const struct GNUNET_MESSENGER_Message * get_room_message(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_HashCode *hash)
Returns a message locally stored from a map for a given hash in a room.
int find_room_member(const struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *contact)
Checks through all members of a given room if a specific contact is found and returns a result depend...
struct GNUNET_MESSENGER_Room * create_room(struct GNUNET_MESSENGER_Handle *handle, const struct GNUNET_HashCode *key)
Creates and allocates a new room for a handle with a given key for the client API.
int iterate_room_members(struct GNUNET_MESSENGER_Room *room, GNUNET_MESSENGER_MemberCallback callback, void *cls)
Iterates through all members of a given room to forward each of them to a selected callback with a cu...
void destroy_room(struct GNUNET_MESSENGER_Room *room)
Destroys a room and frees its memory fully from the client API.
Internal representation of the hash map.
Internal representation of the hash map.
A 512-bit hashcode.
struct GNUNET_MESSENGER_Message * message
struct GNUNET_MESSENGER_Contact * sender
struct GNUNET_MESSENGER_Handle * handle
struct GNUNET_CONTAINER_MultiShortmap * members
struct GNUNET_CONTAINER_MultiHashMap * messages
struct GNUNET_MESSENGER_ListTunnels entries
struct GNUNET_ShortHashCode * contact_id
struct GNUNET_HashCode key
A 256-bit hashcode.