Changeset f73e519


Ignore:
Timestamp:
Jul 9, 2002, 12:52:08 AM (22 years ago)
Author:
Erik Nygren <nygren@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:
ae9e6be
Parents:
1770f30
Message:
	Added simple implementation of smartnarrow-to-admin that
	         creates a "type-admin" autofilter.
		 This was done mostly so that M-C-n and M-C-p do something
		 sane on admin messages.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    re1c4636 rf73e519  
    4949        The '~' character in logpath and classlogpath now gets
    5050                 replaced with the user's home directory.
     51        Added simple implementation of smartnarrow-to-admin that
     52                 creates a "type-admin" autofilter.
     53                 This was done mostly so that M-C-n and M-C-p do something
     54                 sane on admin messages.
    5155       
    52561.2.1-pre-1
  • functions.c

    r10b866d rf73e519  
    17671767}
    17681768
     1769char *owl_function_fasttypefilt(char *type) {
     1770  owl_filter *f;
     1771  char *argbuff, *filtname;
     1772
     1773  /* name for the filter */
     1774  filtname=owl_sprintf("type-%s", type);
     1775
     1776  /* if it already exists then go with it.  This lets users override */
     1777  if (owl_global_get_filter(&g, filtname)) {
     1778    return filtname;
     1779  }
     1780
     1781  /* create the new-internal filter */
     1782  f=owl_malloc(sizeof(owl_filter));
     1783
     1784  argbuff = owl_sprintf("type ^%s$", type);
     1785
     1786  owl_filter_init_fromstring(f, filtname, argbuff);
     1787
     1788  /* add it to the global list */
     1789  owl_global_add_filter(&g, f);
     1790
     1791  /* free stuff */
     1792  owl_free(argbuff);
     1793
     1794  return filtname;
     1795}
     1796
    17691797/* If flag is 1, marks for deletion.  If flag is 0,
    17701798 * unmarks for deletion. */
     
    18121840  }
    18131841
    1814   /* for now we skip admin messages. */
     1842  /* very simple handling of admin messages for now */
    18151843  if (owl_message_is_admin(m)) {
    1816     owl_function_makemsg("Narrowing on an admin message has not been implemented yet.  Check back soon.");
    1817     return NULL;
     1844    return owl_function_fasttypefilt("admin");
    18181845  }
    18191846
Note: See TracChangeset for help on using the changeset viewer.