Changeset 7360fab for functions.c
- Timestamp:
- Jun 29, 2002, 1:21:36 PM (22 years ago)
- 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:
- d36f2cb
- Parents:
- 855ebe7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r855ebe7 r7360fab 1683 1683 } 1684 1684 1685 void owl_function_fastclassinstfilt(char *class, char *instance) { 1686 /* narrow to the current class, instance. If instance is null then 1687 just narrow to the current class */ 1685 char *owl_function_fastclassinstfilt(char *class, char *instance) { 1686 /* creates a filter for a class, instance if one doesn't exist. 1687 * If instance is null then apply for all messgaes in the class. 1688 * returns the name of the filter, which the caller must free.*/ 1688 1689 owl_list *fl; 1689 1690 owl_filter *f; … … 1706 1707 /* if it already exists then go with it. This lets users override */ 1707 1708 if (owl_global_get_filter(&g, filtname)) { 1708 owl_function_change_view(filtname); 1709 owl_free(filtname); 1710 return; 1709 return filtname; 1711 1710 } 1712 1711 … … 1724 1723 owl_global_add_filter(&g, f); 1725 1724 1726 /* set the current view to use it */1727 owl_function_change_view(filtname);1728 1729 1725 owl_free(argbuff); 1730 owl_free(filtname);1731 } 1732 1733 voidowl_function_fastuserfilt(char *user) {1726 return filtname; 1727 } 1728 1729 char *owl_function_fastuserfilt(char *user) { 1734 1730 owl_filter *f; 1735 1731 char *argbuff, *longuser, *shortuser, *filtname; … … 1745 1741 /* if it already exists then go with it. This lets users override */ 1746 1742 if (owl_global_get_filter(&g, filtname)) { 1747 owl_function_change_view(filtname); 1748 owl_free(filtname); 1749 return; 1743 return filtname; 1750 1744 } 1751 1745 … … 1763 1757 owl_global_add_filter(&g, f); 1764 1758 1765 /* set the current view to use it */1766 owl_function_change_view(filtname);1767 1768 1759 /* free stuff */ 1769 1760 owl_free(argbuff); 1770 owl_free(filtname);1771 1761 owl_free(longuser); 1772 1762 owl_free(shortuser); 1773 1763 1764 return filtname; 1774 1765 } 1775 1766 … … 1795 1786 } 1796 1787 1797 void owl_function_smartnarrow(int type) { 1798 /* if the curmsg is a personal message narrow 1788 char *owl_function_smartfilter(int type) { 1789 /* Returns the name of a filter, or null. The caller 1790 * must free this name. */ 1791 /* if the curmsg is a personal message return a filter name 1799 1792 * to the converstaion with that user. 1800 1793 * If the curmsg is a class message, instance foo, recip * 1801 * message, narrowto the class, inst.1802 * If the curmsg is a class message and type==0 then narrow1803 * to the class1804 * If the curmsg is a class message and type==1 then narrow1805 * to the class, instance1794 * message, return a filter name to the class, inst. 1795 * If the curmsg is a class message and type==0 then 1796 * return a filter name for just the class. 1797 * If the curmsg is a class message and type==1 then 1798 * return a filter name for the class and instance. 1806 1799 */ 1807 1800 owl_view *v; 1808 1801 owl_message *m; 1809 char *sender ;1802 char *sender, *filtname=NULL; 1810 1803 1811 1804 v=owl_global_get_current_view(&g); … … 1814 1807 if (owl_view_get_size(v)==0) { 1815 1808 owl_function_makemsg("No message selected\n"); 1816 return ;1809 return NULL; 1817 1810 } 1818 1811 … … 1820 1813 if (owl_message_is_admin(m)) { 1821 1814 owl_function_makemsg("Narrowing on an admin message has not been implemented yet. Check back soon."); 1822 return ;1815 return NULL; 1823 1816 } 1824 1817 … … 1827 1820 if (owl_message_is_zephyr(m)) { 1828 1821 sender=pretty_sender(owl_message_get_sender(m)); 1829 owl_function_fastuserfilt(sender); 1830 free(sender); 1831 } 1832 return; 1822 filtname = owl_function_fastuserfilt(sender); 1823 owl_free(sender); 1824 return filtname; 1825 } 1826 return NULL; 1833 1827 } 1834 1828 … … 1836 1830 if (!strcasecmp(owl_message_get_class(m), "message") && 1837 1831 !owl_message_is_personal(m)) { 1838 owl_function_fastclassinstfilt(owl_message_get_class(m), owl_message_get_instance(m));1839 return ;1832 filtname = owl_function_fastclassinstfilt(owl_message_get_class(m), owl_message_get_instance(m)); 1833 return filtname; 1840 1834 } 1841 1835 1842 1836 /* otherwise narrow to the class */ 1843 1837 if (type==0) { 1844 owl_function_fastclassinstfilt(owl_message_get_class(m), NULL);1838 filtname = owl_function_fastclassinstfilt(owl_message_get_class(m), NULL); 1845 1839 } else if (type==1) { 1846 owl_function_fastclassinstfilt(owl_message_get_class(m), owl_message_get_instance(m)); 1847 } 1840 filtname = owl_function_fastclassinstfilt(owl_message_get_class(m), owl_message_get_instance(m)); 1841 } 1842 return filtname; 1848 1843 } 1849 1844
Note: See TracChangeset
for help on using the changeset viewer.