comparison src/protocols/toc/toc.c @ 4687:283fb289c510

[gaim-migrate @ 4998] This is a new buddy list. Lots of things about it just Don't Work. I probably already know about those things, and you'd just be wasting my time in submitting a bug report about it. I decided that instead of getting it to all work perfectly before committing, that I'd get it in cvs, and slowly fix it with regular commits. That way, it's easier to keep track of things, and other developers can help. Plus, I'm getting pissed off at the buddy list and want it to die. It's kinda boring, and doing nothing but the buddy list for such a long time has just gotten me very bitter. After 0.60 is released later this week, Gaim will resume being fun. This week is going to be very stressful, though, I'm sure. Things you ought to know about this buddy list: - It crashes - It leaks - There's no way to edit the buddy list, or access offline buddies - Most of the menus and buttons and whatnot just plain ol' don't work. - Status icons are only implemented for AIM. That's mostly just because I'm lazy. As such, you may want to be wary of updating this. If you do decide to update this, you may want to learn "cvs update -D yesterday" as well :) All the art there is just placeholder art. You probably won't really have as many problems as it sounds like you will from reading this. This message is extra-negative to stress that I don't want to be bothered with complaints about something not working about it :). I'll repeat: If something doesn't work, I probably already know about it. If you want to actually help with something, I'd be delighted to have it. IM me. -s. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 10 Mar 2003 05:30:31 +0000
parents 42d53c416bb9
children e19f91053ad0
comparison
equal deleted inserted replaced
4686:a1de8a9c99ba 4687:283fb289c510
268 if (gc->inpa > 0) 268 if (gc->inpa > 0)
269 gaim_input_remove(gc->inpa); 269 gaim_input_remove(gc->inpa);
270 gc->inpa = 0; 270 gc->inpa = 0;
271 toc_soc_close(((struct toc_data *)gc->proto_data)->toc_fd); 271 toc_soc_close(((struct toc_data *)gc->proto_data)->toc_fd);
272 g_free(gc->proto_data); 272 g_free(gc->proto_data);
273 }
274
275 static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show)
276 {
277 GSList *grp = groups;
278 GSList *mem;
279 struct group *g;
280 struct buddy *b;
281 GSList *plist = account->permit;
282 GSList *dlist = account->deny;
283
284 int pos = 0;
285
286 if (!account->permdeny)
287 account->permdeny = 1;
288
289 pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny);
290 while (len > pos && grp) {
291 g = (struct group *)grp->data;
292 if(gaim_group_on_account(g, account)) {
293 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name);
294 mem = g->members;
295 while (len > pos && mem) {
296 b = (struct buddy *)mem->data;
297 if(b->account == account) {
298 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name,
299 (show && b->alias[0]) ? ":" : "",
300 (show && b->alias[0]) ? b->alias : "");
301 }
302 mem = mem->next;
303 }
304 }
305 grp = g_slist_next(grp);
306 }
307
308 while (len > pos && plist) {
309 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data);
310 plist = plist->next;
311 }
312
313 while (len > pos && dlist) {
314 pos += g_snprintf(&s[pos], len - pos, "d %s\n", (char *)dlist->data);
315 dlist = dlist->next;
316 }
273 } 317 }
274 318
275 static int escape_message(char *msg) 319 static int escape_message(char *msg)
276 { 320 {
277 char *c, *cpy; 321 char *c, *cpy;
1239 static void toc_keepalive(struct gaim_connection *gc) 1283 static void toc_keepalive(struct gaim_connection *gc)
1240 { 1284 {
1241 sflap_send(gc, "", 0, TYPE_KEEPALIVE); 1285 sflap_send(gc, "", 0, TYPE_KEEPALIVE);
1242 } 1286 }
1243 1287
1244 static char **toc_list_icon(int uc) 1288 static const char *toc_list_icon(struct gaim_account *a, struct buddy *b)
1245 { 1289 {
1290 return "aim";
1291 }
1292 /*
1246 if (uc & UC_UNAVAILABLE) 1293 if (uc & UC_UNAVAILABLE)
1247 return (char **)away_icon_xpm; 1294 return (char **)away_icon_xpm;
1248 if (uc & UC_AOL) 1295 if (uc & UC_AOL)
1249 return (char **)aol_icon_xpm; 1296 return (char **)aol_icon_xpm;
1250 if (uc & UC_NORMAL) 1297 if (uc & UC_NORMAL)
1254 if (uc & UC_UNCONFIRMED) 1301 if (uc & UC_UNCONFIRMED)
1255 return (char **)dt_icon_xpm; 1302 return (char **)dt_icon_xpm;
1256 if (uc & UC_WIRELESS) 1303 if (uc & UC_WIRELESS)
1257 return (char **)wireless_icon_xpm; 1304 return (char **)wireless_icon_xpm;
1258 return NULL; 1305 return NULL;
1259 } 1306 }*/
1260 1307
1261 static GList *toc_buddy_menu(struct gaim_connection *gc, char *who) 1308 static GList *toc_buddy_menu(struct gaim_connection *gc, char *who)
1262 { 1309 {
1263 GList *m = NULL; 1310 GList *m = NULL;
1264 struct proto_buddy_menu *pbm; 1311 struct proto_buddy_menu *pbm;
1284 if (gc->account->permdeny != 3) 1331 if (gc->account->permdeny != 3)
1285 return; 1332 return;
1286 g_snprintf(buf2, sizeof(buf2), "toc_add_permit %s", normalize(who)); 1333 g_snprintf(buf2, sizeof(buf2), "toc_add_permit %s", normalize(who));
1287 sflap_send(gc, buf2, -1, TYPE_DATA); 1334 sflap_send(gc, buf2, -1, TYPE_DATA);
1288 toc_set_config(gc); 1335 toc_set_config(gc);
1289 signoff_blocked(gc);
1290 } 1336 }
1291 1337
1292 static void toc_add_deny(struct gaim_connection *gc, const char *who) 1338 static void toc_add_deny(struct gaim_connection *gc, const char *who)
1293 { 1339 {
1294 char buf2[BUF_LEN * 2]; 1340 char buf2[BUF_LEN * 2];
1295 if (gc->account->permdeny != 4) 1341 if (gc->account->permdeny != 4)
1296 return; 1342 return;
1297 g_snprintf(buf2, sizeof(buf2), "toc_add_deny %s", normalize(who)); 1343 g_snprintf(buf2, sizeof(buf2), "toc_add_deny %s", normalize(who));
1298 sflap_send(gc, buf2, -1, TYPE_DATA); 1344 sflap_send(gc, buf2, -1, TYPE_DATA);
1299 toc_set_config(gc); 1345 toc_set_config(gc);
1300 signoff_blocked(gc);
1301 } 1346 }
1302 1347
1303 static void toc_set_permit_deny(struct gaim_connection *gc) 1348 static void toc_set_permit_deny(struct gaim_connection *gc)
1304 { 1349 {
1305 char buf2[BUF_LEN * 2]; 1350 char buf2[BUF_LEN * 2];
1361 break; 1406 break;
1362 default: 1407 default:
1363 break; 1408 break;
1364 } 1409 }
1365 toc_set_config(gc); 1410 toc_set_config(gc);
1366 signoff_blocked(gc);
1367 } 1411 }
1368 1412
1369 static void toc_rem_permit(struct gaim_connection *gc, const char *who) 1413 static void toc_rem_permit(struct gaim_connection *gc, const char *who)
1370 { 1414 {
1371 if (gc->account->permdeny != 3) 1415 if (gc->account->permdeny != 3)