aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_context.h')
-rw-r--r--src/gnunet_chat_context.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/gnunet_chat_context.h b/src/gnunet_chat_context.h
index 5bafe53..66e777a 100644
--- a/src/gnunet_chat_context.h
+++ b/src/gnunet_chat_context.h
@@ -61,31 +61,80 @@ struct GNUNET_CHAT_Context
61 struct GNUNET_NAMESTORE_QueueEntry *query; 61 struct GNUNET_NAMESTORE_QueueEntry *query;
62}; 62};
63 63
64/**
65 * Creates a chat context from a messenger <i>room</i>
66 * with a selected chat <i>handle</i>.
67 *
68 * @param[in,out] handle Chat handle
69 * @param[in,out] room Messenger room
70 * @return New chat context
71 */
64struct GNUNET_CHAT_Context* 72struct GNUNET_CHAT_Context*
65context_create_from_room (struct GNUNET_CHAT_Handle *handle, 73context_create_from_room (struct GNUNET_CHAT_Handle *handle,
66 struct GNUNET_MESSENGER_Room *room); 74 struct GNUNET_MESSENGER_Room *room);
67 75
76/**
77 * Creates a chat context from a messenger <i>contact</i>
78 * with a selected chat <i>handle</i>.
79 *
80 * @param[in,out] handle Chat handle
81 * @param[in] contact Messenger contact
82 * @return New chat context
83 */
68struct GNUNET_CHAT_Context* 84struct GNUNET_CHAT_Context*
69context_create_from_contact (struct GNUNET_CHAT_Handle *handle, 85context_create_from_contact (struct GNUNET_CHAT_Handle *handle,
70 const struct GNUNET_MESSENGER_Contact *contact); 86 const struct GNUNET_MESSENGER_Contact *contact);
71 87
88/**
89 * Destroys a chat <i>context</i> and frees its memory.
90 *
91 * @param[in,out] context Chat context
92 */
72void 93void
73context_destroy (struct GNUNET_CHAT_Context* context); 94context_destroy (struct GNUNET_CHAT_Context* context);
74 95
96/**
97 * Updates the connected messenger <i>room</i> of a
98 * selected chat <i>context</i>.
99 *
100 * @param[in,out] context Chat context
101 * @param[in,out] room Messenger room
102 */
75void 103void
76context_update_room (struct GNUNET_CHAT_Context *context, 104context_update_room (struct GNUNET_CHAT_Context *context,
77 struct GNUNET_MESSENGER_Room *room); 105 struct GNUNET_MESSENGER_Room *room);
78 106
107/**
108 * Updates the <i>nick</i> of a selected chat <i>context</i>.
109 *
110 * @param[in,out] context Chat context
111 * @param[in] nick Nick name
112 */
79void 113void
80context_update_nick (struct GNUNET_CHAT_Context *context, 114context_update_nick (struct GNUNET_CHAT_Context *context,
81 const char *nick); 115 const char *nick);
82 116
117/**
118 * Reads the <i>data</i> of records under a given <i>label</i>
119 * and updates the chat <i>context</i> with it.
120 *
121 * @param[in,out] context Chat context
122 * @param[in] label Label
123 * @param[in] count Count of data
124 * @param[in] data Records data
125 */
83void 126void
84context_read_records (struct GNUNET_CHAT_Context *context, 127context_read_records (struct GNUNET_CHAT_Context *context,
85 const char *label, 128 const char *label,
86 unsigned int count, 129 unsigned int count,
87 const struct GNUNET_GNSRECORD_Data *data); 130 const struct GNUNET_GNSRECORD_Data *data);
88 131
132/**
133 * Writes the data from a selected chat <i>context</i> into
134 * the namestore as private records.
135 *
136 * @param[in,out] context Chat context
137 */
89void 138void
90context_write_records (struct GNUNET_CHAT_Context *context); 139context_write_records (struct GNUNET_CHAT_Context *context);
91 140