diff options
Diffstat (limited to 'src/gnunet_chat_message.h')
-rw-r--r-- | src/gnunet_chat_message.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gnunet_chat_message.h b/src/gnunet_chat_message.h index 59737ac..e39cc9c 100644 --- a/src/gnunet_chat_message.h +++ b/src/gnunet_chat_message.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2021 GNUnet e.V. | 3 | Copyright (C) 2021--2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 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 | 6 | under the terms of the GNU Affero General Public License as published |
@@ -64,17 +64,43 @@ struct GNUNET_CHAT_Message | |||
64 | enum GNUNET_CHAT_MessageFlag flag; | 64 | enum GNUNET_CHAT_MessageFlag flag; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /** | ||
68 | * Creates a chat message representing an actual message | ||
69 | * from the messenger service in a given chat <i>context</i> | ||
70 | * with a valid <i>hash</i> and message <i>flags</i> | ||
71 | * | ||
72 | * @param[in,out] context Chat context | ||
73 | * @param[in] hash Message hash | ||
74 | * @param[in] flags Message flags | ||
75 | * @param[in] msg Messenger message | ||
76 | * @return New chat message | ||
77 | */ | ||
67 | struct GNUNET_CHAT_Message* | 78 | struct GNUNET_CHAT_Message* |
68 | message_create_from_msg (struct GNUNET_CHAT_Context *context, | 79 | message_create_from_msg (struct GNUNET_CHAT_Context *context, |
69 | const struct GNUNET_HashCode *hash, | 80 | const struct GNUNET_HashCode *hash, |
70 | enum GNUNET_MESSENGER_MessageFlags flags, | 81 | enum GNUNET_MESSENGER_MessageFlags flags, |
71 | const struct GNUNET_MESSENGER_Message *msg); | 82 | const struct GNUNET_MESSENGER_Message *msg); |
72 | 83 | ||
84 | /** | ||
85 | * Creates an internal chat message with an optional chat | ||
86 | * <i>context</i>, a custom <i>flag</i> and an optional | ||
87 | * <i>warning</i> text. | ||
88 | * | ||
89 | * @param[in,out] context Chat context or NULL | ||
90 | * @param[in] flag Chat message flag | ||
91 | * @param[in] warning Warning text | ||
92 | * @return New internal chat message | ||
93 | */ | ||
73 | struct GNUNET_CHAT_Message* | 94 | struct GNUNET_CHAT_Message* |
74 | message_create_internally (struct GNUNET_CHAT_Context *context, | 95 | message_create_internally (struct GNUNET_CHAT_Context *context, |
75 | enum GNUNET_CHAT_MessageFlag flag, | 96 | enum GNUNET_CHAT_MessageFlag flag, |
76 | const char *warning); | 97 | const char *warning); |
77 | 98 | ||
99 | /** | ||
100 | * Destroys a chat <i>message</i> and frees its memory. | ||
101 | * | ||
102 | * @param[in,out] message Chat message | ||
103 | */ | ||
78 | void | 104 | void |
79 | message_destroy (struct GNUNET_CHAT_Message* message); | 105 | message_destroy (struct GNUNET_CHAT_Message* message); |
80 | 106 | ||