% -*- mode: slang; mode: fold; -*- %{{{ MULTIPLE PERSONALITIES and GROUP SPECIFIC SETTINGS (v0.2) % % that's not really a macro, that's a hook. It allows one to % automatically change the name/email address/signature/any setting % depending on a group. % % Put this file in /usr/share/macros/macros.sl (or wherever you wish) % and add the following two lines to .slrnrc: % % set macro_directory "/usr/share/macros" % interpret "macros.sl" % % NOTE: % Remember to add the function to hooks if they already exist; % DO NOT redefine them! % (If you don't understand what hooks are do nothing; they are defined % in the two last lines of the macro. You can learn about hooks from % doc/README.macros (comes with slrn).) % ------------------------------------------------------------------ % by Tomasz Sienicki, tsca@mailserver.dk % See more @ http://www.geocities.com/tsca.geo/slang.html %}}} define komon_hook () { variable signature_file = get_variable_value ("signature"), hostname = get_variable_value ("hostname"), username = get_variable_value ("username"), realname = get_variable_value ("realname"), organization = get_variable_value ("organization"), followup_string = get_variable_value ("followup_string"), mime_charset = get_variable_value ("mime_charset"), followup_custom_headers = get_variable_value ("followup_custom_headers"), custom_headers = get_variable_value ("custom_headers"); % the following applies when posting to groups 'pl.*' --------------------- if (is_substr (current_newsgroup (), "pl.")) { followup_string = " %r napisał\/a\n [w %m]: \n"; mime_charset = "iso-8859-2"; } % the following applies when posting to groups 'pl.test', 'dk.test' and 'alt.test' if (orelse {is_substr (current_newsgroup (), "pl.test")} {is_substr (current_newsgroup (), "dk.test")} {is_substr (current_newsgroup (), "alt.test")} ) { followup_custom_headers = "X-no-archive: yes"; signature_file = "~/signatures/test.sig"; hostname = "non.existant.invalid"; username = "userx"; realname = "John Brown"; organization = "Poorly installed slrn"; } % -------------------------------------------------------------------------- set_string_variable ("signature", signature_file); set_string_variable ("username", username); set_string_variable ("realname", realname); set_string_variable ("hostname", hostname); set_string_variable ("followup_custom_headers", followup_custom_headers); set_string_variable ("custom_headers", custom_headers); set_string_variable ("organization", organization); set_string_variable ("mime_charset", mime_charset); set_string_variable ("followup_string", followup_string); } % here the hooks are defined: ---------------------------------------------- define followup_hook () { komon_hook; } define post_hook () { komon_hook; } % -- END OF FILE --