Changeset fd93b41


Ignore:
Timestamp:
Jun 3, 2003, 5:38:08 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
38cf544c
Parents:
aa5f725
Message:
Started work on 'addbuddy' and 'delbuddy' command but they DO NOT
  WORK yet
Removed a bit of faim code that allowed commands to be executed.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r31e48a3 rfd93b41  
    7575        New built-in filters 'aim' and 'zephyr'.
    7676        Do ZResetAuthentication() before zlog_in and zlog_out as well.
     77        Print AIM login / logout notifications
     78        The 'alist' command prints a list of aim buddies logged in
     79        The 'blist' command prints users from all protocols
     80        The 'l' key is now bound to 'blist' instead of 'zlist'
     81        Started work on 'addbuddy' and 'delbuddy' command but they DO NOT
     82          WORK yet
     83        Removed a bit of faim code that allowed commands to be executed.
     84       
    7785       
    78861.2.8
  • aim.c

    raa5f725 rfd93b41  
    175175}
    176176
     177void owl_aim_addbuddy(char *screenname)
     178{
     179  aim_add_buddy(owl_global_get_aimsess(&g), owl_global_get_waitingconn(&g), screenname);
     180}
     181
     182void owl_aim_delbuddy(char *screenname)
     183{
     184  aim_remove_buddy(owl_global_get_aimsess(&g), NULL, screenname);
     185}
     186
    177187void owl_aim_chat_join(char *chatroom)
    178188{
     
    497507{
    498508  aim_session_kill(sess);
    499 
     509  owl_aim_init();
     510 
    500511  /* kretch
    501512  if (faimtest_init() == -1)
     
    12691280  owl_global_messagequeue_addmsg(&g, m);
    12701281  owl_free(stripmsg);
     1282
     1283  return(1);
    12711284 
    12721285  /* printf("icbm: message: %s\n", realmsg); */
     
    12911304    /* printf("icbm: their icon: iconstamp = %ld, iconlen = 0x%08lx, iconsum = 0x%04x\n", args->iconstamp, args->iconlen, args->iconsum); */
    12921305  }
    1293  
     1306
     1307  /*
    12941308  if (realmsg) {
    12951309    int i = 0;
     
    13041318    faimtest_handlecmd(sess, conn, userinfo, tmpstr);
    13051319  }
     1320  */
    13061321 
    13071322  if (priv->buddyicon && (args->icbmflags & AIM_IMFLAGS_BUDDYREQ)) {
     
    13441359    /* Automatically join room... */
    13451360    /* printf("chat invitiation: autojoining %s...\n", args->info.chat.roominfo.name); */
    1346     aim_chat_join(sess, conn, args->info.chat.roominfo.exchange, args->info.chat.roominfo.name, args->info.chat.roominfo.instance);
     1361
     1362    /* aim_chat_join(sess, conn, args->info.chat.roominfo.exchange, args->info.chat.roominfo.name, args->info.chat.roominfo.instance); */
    13471363  } else if (args->reqclass == AIM_CAPS_IMIMAGE) {
    13481364    directim_requested(sess, conn, userinfo, args);
  • commands.c

    raa5f725 rfd93b41  
    197197              "dump <filename>",
    198198              "Dump messages in current view to the named file."),
     199
     200  OWLCMD_ARGS("addbuddy", owl_command_addbuddy, OWL_CTX_INTERACTIVE,
     201              "add a buddy to a buddylist",
     202              "addbuddy aim <screenname>",
     203              "Add the named buddy to your buddylist.  Eventually other protocols,"
     204              "such as zephyr, will also be able to use this command.  For now the"
     205              "only available protocol is 'aim', specified as the first argument."),
     206
     207  OWLCMD_ARGS("delbuddy", owl_command_delbuddy, OWL_CTX_INTERACTIVE,
     208              "delete a buddy from a buddylist",
     209              "delbuddy aim <screenname>",
     210              "Delete the named buddy to your buddylist.  Eventually other protocols,"
     211              "such as zephyr, will also be able to use this command.  For now the"
     212              "only available protocol is 'aim', specified as the first argument."),
    199213
    200214  OWLCMD_ARGS("smartzpunt", owl_command_smartzpunt, OWL_CTX_INTERACTIVE,
     
    851865  sprintf(buff, "Owl version %s", OWL_VERSION_STRING);
    852866  owl_function_makemsg(buff);
     867}
     868
     869char *owl_command_addbuddy(int argc, char **argv, char *buff)
     870{
     871  if (!owl_global_is_aimloggedin(&g)) {
     872    owl_function_makemsg("addbuddy: You must be logged into aim to use this command.");
     873    return(NULL);
     874  }
     875
     876  if (argc!=3) {
     877    owl_function_makemsg("usage: addbuddy <protocol> <buddyname>");
     878    return(NULL);
     879  }
     880
     881  if (strcasecmp(argv[1], "aim")) {
     882    owl_function_makemsg("addbuddy: currently the only supported protocol is 'aim'");
     883    return(NULL);
     884  }
     885
     886  owl_aim_addbuddy(argv[2]);
     887  owl_function_makemsg("%s added as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     888
     889  return(NULL);
     890}
     891
     892char *owl_command_delbuddy(int argc, char **argv, char *buff)
     893{
     894  if (!owl_global_is_aimloggedin(&g)) {
     895    owl_function_makemsg("delbuddy: You must be logged into aim to use this command.");
     896    return(NULL);
     897  }
     898
     899  if (argc!=3) {
     900    owl_function_makemsg("usage: delbuddy <protocol> <buddyname>");
     901    return(NULL);
     902  }
     903
     904  if (strcasecmp(argv[1], "aim")) {
     905    owl_function_makemsg("delbuddy: currently the only supported protocol is 'aim'");
     906    return(NULL);
     907  }
     908
     909  owl_aim_delbuddy(argv[2]);
     910  owl_function_makemsg("%s deleted as AIM buddy for %s", argv[2], owl_global_get_aim_screenname(&g));
     911
     912  return(NULL);
    853913}
    854914
  • owl_prototypes.h

    raa5f725 rfd93b41  
    44extern void owl_aim_logout(void);
    55extern int owl_aim_send_im(char *to, char *msg);
     6extern void owl_aim_addbuddy(char *screenname);
     7extern void owl_aim_delbuddy(char *screenname);
    68extern void owl_aim_chat_join(char *chatroom);
    79extern void owl_aim_chat_leave(char *chatroom);
     
    5759extern void owl_command_about();
    5860extern void owl_command_version();
     61extern char *owl_command_addbuddy(int argc, char **argv, char *buff);
     62extern char *owl_command_delbuddy(int argc, char **argv, char *buff);
    5963extern char *owl_command_dump(int argc, char **argv, char *buff);
    6064extern char *owl_command_next(int argc, char **argv, char *buff);
Note: See TracChangeset for help on using the changeset viewer.