Changeset aa5f725 for commands.c


Ignore:
Timestamp:
Jun 3, 2003, 3:40:28 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
fd93b41
Parents:
651560f
Message:
added buddylists
added the 'alist' command to print logged in aimusers
added the 'blist' command which prints buddies logged in from all
  protocols.
'l' is now bound to 'blist' by default
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r651560f raa5f725  
    233233              "znol [-f file]",
    234234              "Print a znol-style listing of users logged in"),
    235  
     235
     236  OWLCMD_ARGS("alist", owl_command_alist, OWL_CTX_INTERACTIVE,
     237              "List AIM users logged in",
     238              "alist",
     239              "Print a listing of AIM users logged in"),
     240
     241  OWLCMD_ARGS("blist", owl_command_blist, OWL_CTX_INTERACTIVE,
     242              "List all buddies logged in",
     243              "alist",
     244              "Print a listing of buddies logged in, regardless of protocol."),
     245
    236246  OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE,
    237247              "scrolls receive window to the left", "", ""),
     
    818828    }
    819829  }
    820   owl_function_zlist(file, elapsed, timesort);
     830  owl_function_buddylist(0, 1, file);
     831  return(NULL);
     832}
     833
     834char *owl_command_alist() {
     835  owl_function_buddylist(1, 0, NULL);
     836  return(NULL);
     837}
     838
     839char *owl_command_blist() {
     840  owl_function_buddylist(1, 1, NULL);
    821841  return(NULL);
    822842}
     
    13781398  char *tmpbuff;
    13791399
     1400  if (!owl_global_is_aimloggedin(&g)) {
     1401    owl_function_makemsg("You are not logged in to AIM.");
     1402    return(NULL);
     1403  }
     1404
    13801405  if (argc < 2) {
    13811406    owl_function_makemsg("Not enough arguments to the aimwrite command.");
    1382   } else {
    1383     tmpbuff=owl_strdup(buff);
    1384     owl_function_aimwrite_setup(tmpbuff);
    1385     owl_global_set_buffercommand(&g, tmpbuff);
    1386     owl_free(tmpbuff);
    1387   }
    1388   return NULL;
     1407    return(NULL);
     1408  }
     1409
     1410  tmpbuff=owl_strdup(buff);
     1411  owl_function_aimwrite_setup(tmpbuff);
     1412  owl_global_set_buffercommand(&g, tmpbuff);
     1413  owl_free(tmpbuff);
     1414  return(NULL);
    13891415}
    13901416
     
    17721798char *owl_command_aimlogin(int argc, char **argv, char *buff) {
    17731799  int ret;
    1774 
     1800 
    17751801  if (argc!=3) {
    17761802    owl_function_makemsg("Wrong number of arguments to aimlogin command");
    17771803    return(NULL);
    17781804  }
     1805
     1806  /* clear the buddylist */
     1807  owl_buddylist_clear(owl_global_get_buddylist(&g));
     1808
     1809  /* try to login */
    17791810  ret=owl_aim_login(argv[1], argv[2]);
    17801811  if (!ret) {
     
    17881819
    17891820char *owl_command_aimlogout(int argc, char **argv, char *buff) {
     1821  /* clear the buddylist */
     1822  owl_buddylist_clear(owl_global_get_buddylist(&g));
     1823
    17901824  owl_aim_logout();
    17911825  return(NULL);
Note: See TracChangeset for help on using the changeset viewer.