comparison src/dialogs.c @ 684:b29c92be568b

[gaim-migrate @ 694] bmiller translated perl to C so now gaim can import winaim lists. oh yeah, the permit/deny stuff isn't quite working right. argh. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 15 Aug 2000 17:02:00 +0000
parents 9c49d2456773
children c7c0d2590681
comparison
equal deleted inserted replaced
683:2186b43872b7 684:b29c92be568b
2703 return; 2703 return;
2704 } 2704 }
2705 2705
2706 fgets(first, 64, f); 2706 fgets(first, 64, f);
2707 2707
2708 /* AIM 4 buddy list */
2708 if (!strcasecmp(first, "Config {\n")) { 2709 if (!strcasecmp(first, "Config {\n")) {
2710 debug_print("aim 4\n");
2711 rewind(f);
2712 translate_blt (f, buf);
2713 sprintf(debug_buff, "%s\n", buf);
2714 debug_print(debug_buff);
2715 buf2 = buf;
2716 buf = g_malloc(8193);
2717 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
2718 g_free(buf2);
2719 /* AIM 3 buddy list */
2720 } else if (strstr(first, "group") != NULL) {
2721 debug_print("aim 3\n");
2722 rewind(f);
2723 translate_lst (f, buf);
2724 sprintf(debug_buff, "%s\n", buf);
2725 debug_print(debug_buff);
2726 buf2 = buf;
2727 buf = g_malloc(8193);
2728 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
2729 g_free(buf2);
2730 /* GAIM buddy list - no translation */
2731 } else if (first[0] == 'm') {
2732 rewind(f);
2733 fread(buf, BUF_LONG, 1, f);
2734 buf2 = buf;
2735 buf = g_malloc(8193);
2736 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
2737 g_free(buf2);
2738 /* Something else */
2739 } else {
2709 if ( show_dialog == 1 ) { 2740 if ( show_dialog == 1 ) {
2710 destroy_dialog(NULL, importdialog); 2741 destroy_dialog(NULL, importdialog);
2711 importdialog = NULL; 2742 importdialog = NULL;
2712 } 2743 }
2713 g_free(buf); 2744 g_free(buf);
2714 g_free(first); 2745 g_free(first);
2715 fclose( f ); 2746 fclose( f );
2716 return; 2747 return;
2717 } else if (buf[0] == 'm') { 2748 }
2718 buf2 = buf; 2749
2719 buf = g_malloc(8193);
2720 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2);
2721 g_free(buf2);
2722 }
2723
2724
2725 fseek(f, 0, SEEK_SET);
2726
2727 fread(buf, BUF_LONG, 1, f);
2728
2729 grp = groups;
2730
2731 /* why is this being done? if we merge them than this shouldn't happen
2732 while(grp) {
2733 grp2 = grp->next;
2734 remove_group((struct group *)grp->data);
2735 grp = grp2;
2736 }
2737 */
2738
2739 parse_toc_buddy_list(buf, 1); 2750 parse_toc_buddy_list(buf, 1);
2740 2751
2741 serv_save_config(); 2752 serv_save_config();
2742 2753
2743 build_edit_tree(); 2754 build_edit_tree();
2744 build_permit_tree(); 2755 build_permit_tree();
2745 2756
2746 fclose( f ); 2757 fclose( f );
2747 2758
2748 if ( show_dialog == 1 ) { 2759 if ( show_dialog == 1 ) {
2749 /* save what we just did to cache */ 2760 /* save what we just did to cache */
2750 2761
2751 do_export( (GtkWidget *) NULL, 0 ); 2762 do_export( (GtkWidget *) NULL, 0 );
2752 destroy_dialog(NULL, importdialog); 2763 destroy_dialog(NULL, importdialog);
2753 importdialog = NULL; 2764 importdialog = NULL;
2754 } 2765 }
2755 2766
2756 g_free(buf); 2767 g_free(buf);
2757 g_free(first); 2768 g_free(first);
2758 } 2769 }
2759 2770
2760 void show_import_dialog() 2771 void show_import_dialog()