| 678 |
678 |
| 679 static void |
679 static void |
| 680 silcpurple_chat_ulimit_cb(SilcPurpleChatInput s, const char *limit) |
680 silcpurple_chat_ulimit_cb(SilcPurpleChatInput s, const char *limit) |
| 681 { |
681 { |
| 682 SilcChannelEntry channel; |
682 SilcChannelEntry channel; |
| 683 int ulimit = 0; |
683 guint ulimit = 0; |
| 684 |
684 |
| 685 channel = silc_client_get_channel(s->sg->client, s->sg->conn, |
685 channel = silc_client_get_channel(s->sg->client, s->sg->conn, |
| 686 (char *)s->channel); |
686 (char *)s->channel); |
| 687 if (!channel) |
687 if (!channel) |
| 688 return; |
688 return; |
| 689 if (limit) |
689 if (limit) |
| 690 ulimit = atoi(limit); |
690 ulimit = strtoul(limit, NULL, 10); |
| 691 |
691 |
| 692 if (!limit || !(*limit) || *limit == '0') { |
692 if (!limit || !(*limit) || *limit == '0') { |
| 693 if (limit && ulimit == channel->user_limit) { |
693 if (limit && ulimit == channel->user_limit) { |
| 694 g_free(s->channel); |
694 g_free(s->channel); |
| 695 silc_free(s); |
695 silc_free(s); |
| 1118 if (id > SILCPURPLE_PRVGRP) { |
1118 if (id > SILCPURPLE_PRVGRP) { |
| 1119 GList *l; |
1119 GList *l; |
| 1120 SilcPurplePrvgrp prv; |
1120 SilcPurplePrvgrp prv; |
| 1121 |
1121 |
| 1122 for (l = sg->grps; l; l = l->next) |
1122 for (l = sg->grps; l; l = l->next) |
| 1123 if (((SilcPurplePrvgrp)l->data)->id == id) |
1123 if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) |
| 1124 break; |
1124 break; |
| 1125 if (!l) |
1125 if (!l) |
| 1126 return; |
1126 return; |
| 1127 prv = l->data; |
1127 prv = l->data; |
| 1128 id = prv->chid; |
1128 id = prv->chid; |
| 1129 } |
1129 } |
| 1130 |
1130 |
| 1131 /* Find channel by id */ |
1131 /* Find channel by id */ |
| 1132 silc_hash_table_list(conn->local_entry->channels, &htl); |
1132 silc_hash_table_list(conn->local_entry->channels, &htl); |
| 1133 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
1133 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
| 1134 if (SILC_PTR_TO_32(chu->channel->context) == id ) { |
1134 if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { |
| 1135 found = TRUE; |
1135 found = TRUE; |
| 1136 break; |
1136 break; |
| 1137 } |
1137 } |
| 1138 } |
1138 } |
| 1139 silc_hash_table_list_reset(&htl); |
1139 silc_hash_table_list_reset(&htl); |
| 1163 /* See if we are leaving a private group */ |
1163 /* See if we are leaving a private group */ |
| 1164 if (id > SILCPURPLE_PRVGRP) { |
1164 if (id > SILCPURPLE_PRVGRP) { |
| 1165 SilcChannelEntry channel; |
1165 SilcChannelEntry channel; |
| 1166 |
1166 |
| 1167 for (l = sg->grps; l; l = l->next) |
1167 for (l = sg->grps; l; l = l->next) |
| 1168 if (((SilcPurplePrvgrp)l->data)->id == id) |
1168 if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) |
| 1169 break; |
1169 break; |
| 1170 if (!l) |
1170 if (!l) |
| 1171 return; |
1171 return; |
| 1172 prv = l->data; |
1172 prv = l->data; |
| 1173 channel = silc_client_get_channel(sg->client, sg->conn, |
1173 channel = silc_client_get_channel(sg->client, sg->conn, |
| 1183 } |
1183 } |
| 1184 |
1184 |
| 1185 /* Find channel by id */ |
1185 /* Find channel by id */ |
| 1186 silc_hash_table_list(conn->local_entry->channels, &htl); |
1186 silc_hash_table_list(conn->local_entry->channels, &htl); |
| 1187 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
1187 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
| 1188 if (SILC_PTR_TO_32(chu->channel->context) == id ) { |
1188 if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { |
| 1189 found = TRUE; |
1189 found = TRUE; |
| 1190 break; |
1190 break; |
| 1191 } |
1191 } |
| 1192 } |
1192 } |
| 1193 silc_hash_table_list_reset(&htl); |
1193 silc_hash_table_list_reset(&htl); |
| 1200 |
1200 |
| 1201 serv_got_chat_left(gc, id); |
1201 serv_got_chat_left(gc, id); |
| 1202 |
1202 |
| 1203 /* Leave from private groups on this channel as well */ |
1203 /* Leave from private groups on this channel as well */ |
| 1204 for (l = sg->grps; l; l = l->next) |
1204 for (l = sg->grps; l; l = l->next) |
| 1205 if (((SilcPurplePrvgrp)l->data)->chid == id) { |
1205 if (((SilcPurplePrvgrp)l->data)->chid == (gulong)id) { |
| 1206 prv = l->data; |
1206 prv = l->data; |
| 1207 silc_client_del_channel_private_key(client, conn, |
1207 silc_client_del_channel_private_key(client, conn, |
| 1208 chu->channel, |
1208 chu->channel, |
| 1209 prv->key); |
1209 prv->key); |
| 1210 serv_got_chat_left(gc, prv->id); |
1210 serv_got_chat_left(gc, prv->id); |
| 1284 |
1284 |
| 1285 if (!channel) { |
1285 if (!channel) { |
| 1286 /* Find channel by id */ |
1286 /* Find channel by id */ |
| 1287 silc_hash_table_list(conn->local_entry->channels, &htl); |
1287 silc_hash_table_list(conn->local_entry->channels, &htl); |
| 1288 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
1288 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
| 1289 if (SILC_PTR_TO_32(chu->channel->context) == id ) { |
1289 if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { |
| 1290 found = TRUE; |
1290 found = TRUE; |
| 1291 break; |
1291 break; |
| 1292 } |
1292 } |
| 1293 } |
1293 } |
| 1294 silc_hash_table_list_reset(&htl); |
1294 silc_hash_table_list_reset(&htl); |
| 1355 if (id > SILCPURPLE_PRVGRP) { |
1355 if (id > SILCPURPLE_PRVGRP) { |
| 1356 GList *l; |
1356 GList *l; |
| 1357 SilcPurplePrvgrp prv; |
1357 SilcPurplePrvgrp prv; |
| 1358 |
1358 |
| 1359 for (l = sg->grps; l; l = l->next) |
1359 for (l = sg->grps; l; l = l->next) |
| 1360 if (((SilcPurplePrvgrp)l->data)->id == id) |
1360 if (((SilcPurplePrvgrp)l->data)->id == (gulong)id) |
| 1361 break; |
1361 break; |
| 1362 if (!l) |
1362 if (!l) |
| 1363 return; |
1363 return; |
| 1364 prv = l->data; |
1364 prv = l->data; |
| 1365 id = prv->chid; |
1365 id = prv->chid; |
| 1366 } |
1366 } |
| 1367 |
1367 |
| 1368 /* Find channel by id */ |
1368 /* Find channel by id */ |
| 1369 silc_hash_table_list(conn->local_entry->channels, &htl); |
1369 silc_hash_table_list(conn->local_entry->channels, &htl); |
| 1370 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
1370 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { |
| 1371 if (SILC_PTR_TO_32(chu->channel->context) == id ) { |
1371 if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) { |
| 1372 found = TRUE; |
1372 found = TRUE; |
| 1373 break; |
1373 break; |
| 1374 } |
1374 } |
| 1375 } |
1375 } |
| 1376 silc_hash_table_list_reset(&htl); |
1376 silc_hash_table_list_reset(&htl); |