aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_handle_intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_handle_intern.c')
-rw-r--r--src/gnunet_chat_handle_intern.c63
1 files changed, 54 insertions, 9 deletions
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c
index bcf0508..17bff20 100644
--- a/src/gnunet_chat_handle_intern.c
+++ b/src/gnunet_chat_handle_intern.c
@@ -71,13 +71,21 @@ notify_handle_fs_progress(void* cls, const struct GNUNET_FS_ProgressInfo* info)
71 case GNUNET_FS_STATUS_PUBLISH_START: { 71 case GNUNET_FS_STATUS_PUBLISH_START: {
72 struct GNUNET_CHAT_File *file = info->value.publish.cctx; 72 struct GNUNET_CHAT_File *file = info->value.publish.cctx;
73 73
74 file->published = 0; 74 file_update_upload(
75 file,
76 0,
77 info->value.publish.size
78 );
75 79
76 return file; 80 return file;
77 } case GNUNET_FS_STATUS_PUBLISH_PROGRESS: { 81 } case GNUNET_FS_STATUS_PUBLISH_PROGRESS: {
78 struct GNUNET_CHAT_File *file = info->value.publish.cctx; 82 struct GNUNET_CHAT_File *file = info->value.publish.cctx;
79 83
80 file->published = info->value.publish.completed; 84 file_update_upload(
85 file,
86 info->value.publish.completed,
87 info->value.publish.size
88 );
81 89
82 return file; 90 return file;
83 } case GNUNET_FS_STATUS_PUBLISH_COMPLETED: { 91 } case GNUNET_FS_STATUS_PUBLISH_COMPLETED: {
@@ -87,7 +95,12 @@ notify_handle_fs_progress(void* cls, const struct GNUNET_FS_ProgressInfo* info)
87 info->value.publish.specifics.completed.chk_uri 95 info->value.publish.specifics.completed.chk_uri
88 ); 96 );
89 97
90 file->published = info->value.publish.size; 98 file_update_upload(
99 file,
100 info->value.publish.size,
101 info->value.publish.size
102 );
103
91 file->publish = NULL; 104 file->publish = NULL;
92 break; 105 break;
93 } case GNUNET_FS_STATUS_PUBLISH_ERROR: { 106 } case GNUNET_FS_STATUS_PUBLISH_ERROR: {
@@ -95,7 +108,11 @@ notify_handle_fs_progress(void* cls, const struct GNUNET_FS_ProgressInfo* info)
95 } case GNUNET_FS_STATUS_DOWNLOAD_START: { 108 } case GNUNET_FS_STATUS_DOWNLOAD_START: {
96 struct GNUNET_CHAT_File *file = info->value.download.cctx; 109 struct GNUNET_CHAT_File *file = info->value.download.cctx;
97 110
98 file->downloaded = 0; 111 file_update_download(
112 file,
113 0,
114 info->value.download.size
115 );
99 116
100 return file; 117 return file;
101 } case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: { 118 } case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: {
@@ -105,13 +122,22 @@ notify_handle_fs_progress(void* cls, const struct GNUNET_FS_ProgressInfo* info)
105 } case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: { 122 } case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: {
106 struct GNUNET_CHAT_File *file = info->value.download.cctx; 123 struct GNUNET_CHAT_File *file = info->value.download.cctx;
107 124
108 file->downloaded = info->value.download.completed; 125 file_update_download(
126 file,
127 info->value.download.completed,
128 info->value.download.size
129 );
109 130
110 return file; 131 return file;
111 } case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: { 132 } case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: {
112 struct GNUNET_CHAT_File *file = info->value.download.cctx; 133 struct GNUNET_CHAT_File *file = info->value.download.cctx;
113 134
114 file->downloaded = info->value.download.size; 135 file_update_download(
136 file,
137 info->value.download.size,
138 info->value.download.size
139 );
140
115 file->download = NULL; 141 file->download = NULL;
116 break; 142 break;
117 } case GNUNET_FS_STATUS_DOWNLOAD_ERROR: { 143 } case GNUNET_FS_STATUS_DOWNLOAD_ERROR: {
@@ -119,19 +145,32 @@ notify_handle_fs_progress(void* cls, const struct GNUNET_FS_ProgressInfo* info)
119 } case GNUNET_FS_STATUS_UNINDEX_START: { 145 } case GNUNET_FS_STATUS_UNINDEX_START: {
120 struct GNUNET_CHAT_File *file = info->value.unindex.cctx; 146 struct GNUNET_CHAT_File *file = info->value.unindex.cctx;
121 147
122 file->unindexed = 0; 148 file_update_unindex(
149 file,
150 0,
151 info->value.unindex.size
152 );
123 153
124 return file; 154 return file;
125 } case GNUNET_FS_STATUS_UNINDEX_PROGRESS: { 155 } case GNUNET_FS_STATUS_UNINDEX_PROGRESS: {
126 struct GNUNET_CHAT_File *file = info->value.unindex.cctx; 156 struct GNUNET_CHAT_File *file = info->value.unindex.cctx;
127 157
128 file->unindexed = info->value.unindex.completed; 158 file_update_unindex(
159 file,
160 info->value.unindex.completed,
161 info->value.unindex.size
162 );
129 163
130 return file; 164 return file;
131 } case GNUNET_FS_STATUS_UNINDEX_COMPLETED: { 165 } case GNUNET_FS_STATUS_UNINDEX_COMPLETED: {
132 struct GNUNET_CHAT_File *file = info->value.unindex.cctx; 166 struct GNUNET_CHAT_File *file = info->value.unindex.cctx;
133 167
134 file->unindexed = info->value.unindex.size; 168 file_update_unindex(
169 file,
170 info->value.unindex.size,
171 info->value.unindex.size
172 );
173
135 file->unindex = NULL; 174 file->unindex = NULL;
136 break; 175 break;
137 } default: { 176 } default: {
@@ -225,6 +264,11 @@ request_handle_context_by_room (struct GNUNET_CHAT_Handle *handle,
225 handle, context 264 handle, context
226 ); 265 );
227 266
267 group_load_config(group);
268
269 if (group->topic)
270 group_publish(group);
271
228 if (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put( 272 if (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(
229 handle->groups, key, group, 273 handle->groups, key, group,
230 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)) 274 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST))
@@ -382,6 +426,7 @@ it_destroy_handle_groups (GNUNET_UNUSED void *cls,
382 void *value) 426 void *value)
383{ 427{
384 struct GNUNET_CHAT_Group *group = value; 428 struct GNUNET_CHAT_Group *group = value;
429 group_save_config(group);
385 group_destroy(group); 430 group_destroy(group);
386 return GNUNET_YES; 431 return GNUNET_YES;
387} 432}