comparison src/multi.c @ 980:82c5865f7cfe

[gaim-migrate @ 990] i hope this works committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 12 Oct 2000 18:59:36 +0000
parents e5eac6b236f1
children 7e231bc0018a
comparison
equal deleted inserted replaced
979:ae6d13c11570 980:82c5865f7cfe
80 return gc; 80 return gc;
81 } 81 }
82 82
83 void destroy_gaim_conn(struct gaim_connection *gc) 83 void destroy_gaim_conn(struct gaim_connection *gc)
84 { 84 {
85 switch (gc->protocol) {
86 case PROTO_TOC:
87 break;
88 case PROTO_OSCAR:
89 break;
90 default:
91 /* PRPL */
92 break;
93 }
94 connections = g_slist_remove(connections, gc); 85 connections = g_slist_remove(connections, gc);
95 g_free(gc); 86 g_free(gc);
96 redo_convo_menus(); 87 redo_convo_menus();
97 } 88 }
98 89
452 } 443 }
453 444
454 static void pass_signon(GtkWidget *w, struct aim_user *u) 445 static void pass_signon(GtkWidget *w, struct aim_user *u)
455 { 446 {
456 char *txt = gtk_entry_get_text(GTK_ENTRY(u->passentry)); 447 char *txt = gtk_entry_get_text(GTK_ENTRY(u->passentry));
457 char *un, *ps; 448 g_snprintf(u->password, sizeof(u->password), "%s", txt);
458 #ifdef USE_APPLET 449 #ifdef USE_APPLET
459 set_user_state(signing_on); 450 set_user_state(signing_on);
460 #endif 451 #endif
461 un = g_strdup(u->username);
462 ps = g_strdup(txt);
463 gtk_widget_destroy(u->passprmt); 452 gtk_widget_destroy(u->passprmt);
464 u->passprmt = NULL; 453 u->passprmt = NULL;
465 serv_login(un, ps); 454 serv_login(u);
466 g_free(un);
467 g_free(ps);
468 } 455 }
469 456
470 static void do_pass_dlg(struct aim_user *u) 457 static void do_pass_dlg(struct aim_user *u)
471 { 458 {
472 /* we can safely assume that u is not NULL */ 459 /* we can safely assume that u is not NULL */
535 if (row != -1) { 522 if (row != -1) {
536 gtk_clist_get_text(GTK_CLIST(list), row, 0, &name); 523 gtk_clist_get_text(GTK_CLIST(list), row, 0, &name);
537 u = find_user(name); 524 u = find_user(name);
538 gc = find_gaim_conn_by_name(name); 525 gc = find_gaim_conn_by_name(name);
539 if (!gc) { 526 if (!gc) {
540 char *un, *ps;
541 if (!u->password[0]) { 527 if (!u->password[0]) {
542 do_pass_dlg(u); 528 do_pass_dlg(u);
543 } else { 529 } else {
544 #ifdef USE_APPLET 530 #ifdef USE_APPLET
545 set_user_state(signing_on); 531 set_user_state(signing_on);
546 #endif /* USE_APPLET */ 532 #endif /* USE_APPLET */
547 533 serv_login(u);
548 un = g_strdup(u->username);
549 ps = g_strdup(u->password);
550 gc = serv_login(un, ps);
551 g_free(un);
552 g_free(ps);
553 } 534 }
554 } else { 535 } else {
555 signoff(gc); 536 signoff(gc);
556 } 537 }
557 } 538 }
658 639
659 void auto_login() 640 void auto_login()
660 { 641 {
661 GList *u = aim_users; 642 GList *u = aim_users;
662 struct aim_user *a = NULL; 643 struct aim_user *a = NULL;
663 char *un, *ps;
664 644
665 while (u) { 645 while (u) {
666 a = (struct aim_user *)u->data; 646 a = (struct aim_user *)u->data;
667 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) { 647 if ((a->options & OPT_USR_AUTO) && (a->options & OPT_USR_REM_PASS)) {
668 #ifdef USE_APPLET 648 #ifdef USE_APPLET
669 set_user_state(signing_on); 649 set_user_state(signing_on);
670 #endif /* USE_APPLET */ 650 #endif /* USE_APPLET */
671 651 serv_login(a);
672 un = g_strdup(a->username);
673 ps = g_strdup(a->password);
674 serv_login(un, ps);
675 g_free(un);
676 g_free(ps);
677 } 652 }
678 u = u->next; 653 u = u->next;
679 } 654 }
680 } 655 }