libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

gnunet_chat_group.h (2069B)


      1 /*
      2    This file is part of GNUnet.
      3    Copyright (C) 2021--2024 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  */
     20 /*
     21  * @author Tobias Frisch
     22  * @file gnunet_chat_group.h
     23  */
     24 
     25 #ifndef GNUNET_CHAT_GROUP_H_
     26 #define GNUNET_CHAT_GROUP_H_
     27 
     28 #include <gnunet/gnunet_regex_service.h>
     29 #include <gnunet/gnunet_util_lib.h>
     30 
     31 struct GNUNET_CHAT_Handle;
     32 struct GNUNET_CHAT_Context;
     33 
     34 struct GNUNET_CHAT_Group
     35 {
     36   struct GNUNET_CHAT_Handle *handle;
     37   struct GNUNET_CHAT_Context *context;
     38 
     39   struct GNUNET_SCHEDULER_Task *destruction;
     40 
     41   struct GNUNET_REGEX_Announcement *announcement;
     42   struct GNUNET_REGEX_Search *search;
     43 
     44   struct GNUNET_CONTAINER_MultiPeerMap *registry;
     45 
     46   void *user_pointer;
     47 };
     48 
     49 /**
     50  * Creates a chat group from a chat <i>context</i>
     51  * with a selected chat <i>handle</i>.
     52  *
     53  * @param[in,out] handle Chat handle
     54  * @param[in,out] context Chat context
     55  * @return New chat group
     56  */
     57 struct GNUNET_CHAT_Group*
     58 group_create_from_context (struct GNUNET_CHAT_Handle *handle,
     59 			                     struct GNUNET_CHAT_Context *context);
     60 
     61 /**
     62  * Destroys a chat <i>group</i> and frees its memory.
     63  *
     64  * @param[in,out] group Chat group
     65  */
     66 void
     67 group_destroy (struct GNUNET_CHAT_Group* group);
     68 
     69 /**
     70  * Publishes a selected chat <i>group</i> under the
     71  * topic of its context.
     72  *
     73  * @param[in,out] group Chat group
     74  */
     75 void
     76 group_publish (struct GNUNET_CHAT_Group* group);
     77 
     78 #endif /* GNUNET_CHAT_GROUP_H_ */