comparison src/util.c @ 3726:d85208a99af2

[gaim-migrate @ 3862] (12:18:46) Robot101: it switches the .desktop file to the new KDE/GNOME common vfolder format (12:18:48) Robot101: and location (12:19:01) Robot101: and it moves a function from util.c to aim.c and makes it static (12:19:08) Robot101: because it's only used by the main window and removes a function herman #ifdef 0'ed, and fixes a segfault in the docklet. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 17 Oct 2002 16:25:54 +0000
parents b401bd1701b4
children 12b29552f1d7
comparison
equal deleted inserted replaced
3725:dd48b1ac5bd8 3726:d85208a99af2
804 "Usage: %s [OPTION]...\n\n" 804 "Usage: %s [OPTION]...\n\n"
805 " -a, --acct display account editor window\n" 805 " -a, --acct display account editor window\n"
806 " -w, --away[=MESG] make away on signon (optional argument MESG specifies\n" 806 " -w, --away[=MESG] make away on signon (optional argument MESG specifies\n"
807 " name of away message to use)\n" 807 " name of away message to use)\n"
808 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" 808 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n"
809 " account(s) to use)\n" 809 " account(s) to use, seperated by commas)\n"
810 " -n, --loginwin don't automatically login; show login window\n" 810 " -n, --loginwin don't automatically login; show login window\n"
811 " -u, --user=NAME use account NAME\n" 811 " -u, --user=NAME use account NAME\n"
812 " -f, --file=FILE use FILE as config\n" 812 " -f, --file=FILE use FILE as config\n"
813 " -d, --debug print debugging messages to stdout\n" 813 " -d, --debug print debugging messages to stdout\n"
814 " -v, --version display the current version and exit\n" 814 " -v, --version display the current version and exit\n"
816 break; 816 break;
817 case 1: /* short message */ 817 case 1: /* short message */
818 printf("Gaim %s. Try `%s -h' for more information.\n", VERSION, name); 818 printf("Gaim %s. Try `%s -h' for more information.\n", VERSION, name);
819 break; 819 break;
820 } 820 }
821 }
822
823
824 /* <name> is a comma-separated list of names, or NULL
825 if NULL and there is at least one user defined in .gaimrc, try to login.
826 if not NULL, parse <name> into separate strings, look up each one in
827 .gaimrc and, if it's there, try to login.
828 returns: 0 if successful
829 -1 if no user was found that had a saved password
830 */
831 int do_auto_login(char *name)
832 {
833 struct aim_user *u;
834 char **names, **n;
835 int retval = -1;
836
837 if (name !=NULL) { /* list of names given */
838 names = g_strsplit(name, ",", 32);
839 for (n = names; *n != NULL; n++) {
840 u = find_user(*n, -1);
841 if (u) { /* found a user */
842 if (u->options & OPT_USR_REM_PASS) {
843 retval = 0;
844 serv_login(u);
845 }
846 }
847 }
848 g_strfreev(names);
849 } else { /* no name given, use default */
850 u = (struct aim_user *)aim_users->data;
851 if (u->options & OPT_USR_REM_PASS) {
852 retval = 0;
853 serv_login(u);
854 }
855 }
856
857 return retval;
858 } 821 }
859 822
860 GSList *message_split(char *message, int limit) 823 GSList *message_split(char *message, int limit)
861 { 824 {
862 static GSList *ret = NULL; 825 static GSList *ret = NULL;