Changeset 216c734


Ignore:
Timestamp:
Oct 24, 2006, 12:40:02 PM (14 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
0138478
Parents:
4211f50b
Message:
Adding my getstyle patch, which I rely on from perl right now for a
number of my "modules".
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r4211f50b r216c734  
    703703              "returns the value of a variable",
    704704              "getvar <varname>", ""),
     705
     706  OWLCMD_ARGS("getstyle", owl_command_getstyle, OWL_CTX_INTERACTIVE,
     707              "returns the name of the style for the current view",
     708              "", ""),
    705709
    706710  OWLCMD_ARGS("search", owl_command_search, OWL_CTX_INTERACTIVE,
     
    23952399}
    23962400
     2401char *owl_command_getstyle(int argc, char **argv, char *buff)
     2402{
     2403  char *stylename;
     2404  if (argc != 1) {
     2405    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     2406    return NULL;
     2407  }
     2408  stylename = owl_view_get_style_name(owl_global_get_current_view(&g));
     2409  if (stylename) stylename = owl_strdup(stylename);
     2410  return stylename;
     2411}
     2412
    23972413/*********************************************************************/
    23982414/************************** EDIT SPECIFIC ****************************/
  • perlconfig.c

    r908e388 r216c734  
    7878  hv_store(h, "id", strlen("id"), newSViv(owl_message_get_id(m)),0);
    7979  hv_store(h, "deleted", strlen("deleted"), newSViv(owl_message_is_delete(m)),0);
     80  hv_store(h, "private", strlen("private"), newSViv(owl_message_is_private(m)),0);
    8081
    8182  if (owl_message_is_type_zephyr(m))       blessas = "owl::Message::Zephyr";
  • perlwrap.pm

    r87c6ef1 r216c734  
    4545sub recipient   { return shift->{"recipient"}; }
    4646sub login       { return shift->{"login"}; }
     47sub is_private  { return shift->{"private"}; }
    4748
    4849sub is_login    { return shift->login eq "login"; }
     
    6364sub is_mail     { return 0; }
    6465sub is_personal { return undef; }
    65 sub is_private  { return undef; }
    6666sub class       { return undef; }
    6767sub instance    { return undef; }
     
    191191sub is_ping     { return (lc(shift->opcode) eq "ping"); }
    192192
    193 sub is_private {
    194     my ($m) = @_;
    195     return (lc($m->recipient) eq lc(owl::zephyr_getsender()));
    196 }
    197 
    198193sub is_personal {
    199194    my ($m) = @_;
Note: See TracChangeset for help on using the changeset viewer.