Changeset ce7db4d for commands.c


Ignore:
Timestamp:
Jun 24, 2003, 11:12:09 PM (17 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:
658dc2f
Parents:
723c427
Message:
zwrite -m now logs and displays an outgoing message
zwrite -s now works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    ref56a67 rce7db4d  
    15261526
    15271527char *owl_command_zwrite(int argc, char **argv, char *buff) {
    1528   char *tmpbuff, *pos, *cmd, *msg;
     1528  owl_zwrite z;
    15291529
    15301530  /* check for a zwrite -m */
    1531   for (pos = buff; *pos; pos = skiptokens(pos, 1)) {
    1532     if (!strncmp(pos, "-m ", 3)) {
    1533       cmd = owl_strdup(buff);
    1534       msg = cmd+(pos-buff);
    1535       *msg = '\0';
    1536       msg += 3;
    1537       owl_zwrite_create_and_send_from_line(cmd, msg);
    1538       owl_free(cmd);
    1539       return NULL;
    1540     }
     1531  owl_zwrite_create_from_line(&z, buff);
     1532  if (owl_zwrite_is_message_set(&z)) {
     1533    owl_function_zwrite(buff, NULL);
     1534    owl_zwrite_free(&z);
     1535    return (NULL);
    15411536  }
    15421537
     
    15441539    owl_function_makemsg("Not enough arguments to the zwrite command.");
    15451540  } else {
    1546     tmpbuff = owl_strdup(buff);
    1547     owl_function_zwrite_setup(tmpbuff);
    1548     owl_global_set_buffercommand(&g, tmpbuff);
    1549     owl_free(tmpbuff);
    1550   }
    1551   return NULL;
     1541    owl_function_zwrite_setup(buff);
     1542    owl_global_set_buffercommand(&g, buff);
     1543  }
     1544  return(NULL);
    15521545}
    15531546
    15541547char *owl_command_aimwrite(int argc, char **argv, char *buff) {
    1555   char *tmpbuff;
    1556 
    15571548  if (!owl_global_is_aimloggedin(&g)) {
    15581549    owl_function_makemsg("You are not logged in to AIM.");
     
    15651556  }
    15661557
    1567   tmpbuff=owl_strdup(buff);
    1568   owl_function_aimwrite_setup(tmpbuff);
    1569   owl_global_set_buffercommand(&g, tmpbuff);
    1570   owl_free(tmpbuff);
     1558  owl_function_aimwrite_setup(buff);
     1559  owl_global_set_buffercommand(&g, buff);
    15711560  return(NULL);
    15721561}
    15731562
    15741563char *owl_command_zcrypt(int argc, char **argv, char *buff) {
    1575   char *tmpbuff, *pos, *cmd, *msg;
    1576  
     1564  owl_zwrite z;
     1565
    15771566  /* check for a zwrite -m */
    1578   for (pos = buff; *pos; pos = skiptokens(pos, 1)) {
    1579     if (!strncmp(pos, "-m ", 3)) {
    1580       cmd = owl_strdup(buff);
    1581       msg = cmd+(pos-buff);
    1582       *msg = '\0';
    1583       msg += 3;
    1584       owl_zwrite_create_and_send_from_line(cmd, msg);
    1585       owl_free(cmd);
    1586       return NULL;
    1587     }
     1567  owl_zwrite_create_from_line(&z, buff);
     1568  if (owl_zwrite_is_message_set(&z)) {
     1569    owl_zwrite_send_message(&z);
     1570    owl_function_make_outgoing_zephyr(owl_zwrite_get_message(&z), buff, owl_zwrite_get_zsig(&z));
     1571    owl_zwrite_free(&z);
     1572    return (NULL);
    15881573  }
    15891574
     
    15911576    owl_function_makemsg("Not enough arguments to the zcrypt command.");
    15921577  } else {
    1593     tmpbuff = owl_strdup(buff);
    1594     owl_function_zwrite_setup(tmpbuff);
    1595     owl_global_set_buffercommand(&g, tmpbuff);
    1596     owl_free(tmpbuff);
     1578    owl_function_zwrite_setup(buff);
     1579    owl_global_set_buffercommand(&g, buff);
    15971580  }
    15981581  return(NULL);
Note: See TracChangeset for help on using the changeset viewer.