]> git.pld-linux.org Git - packages/slrn.git/blob - slrn-user-agent.patch
- rediff patches
[packages/slrn.git] / slrn-user-agent.patch
1 diff -urNp -x '*.orig' slrn-1.0.3.org/macros/INSTFILES slrn-1.0.3/macros/INSTFILES
2 --- slrn-1.0.3.org/macros/INSTFILES     2016-10-24 00:34:16.000000000 +0200
3 +++ slrn-1.0.3/macros/INSTFILES 2021-10-03 22:48:59.187724986 +0200
4 @@ -15,3 +15,4 @@ varset.sl
5  xcomment.sl
6  mime.sl
7  mailcap.sl
8 +uname.sl
9 diff -urNp -x '*.orig' slrn-1.0.3.org/macros/uname.sl slrn-1.0.3/macros/uname.sl
10 --- slrn-1.0.3.org/macros/uname.sl      1970-01-01 01:00:00.000000000 +0100
11 +++ slrn-1.0.3/macros/uname.sl  2021-10-03 22:48:59.187724986 +0200
12 @@ -0,0 +1,4 @@
13 +% example of customizing User-Agent header
14 +
15 +set_string_variable("system_type", uname().sysname + " " + uname().release
16 +    + "/" + uname().machine);
17 diff -urNp -x '*.orig' slrn-1.0.3.org/src/misc.h slrn-1.0.3/src/misc.h
18 --- slrn-1.0.3.org/src/misc.h   2016-10-24 00:34:16.000000000 +0200
19 +++ slrn-1.0.3/src/misc.h       2021-10-03 22:48:59.187724986 +0200
20 @@ -83,6 +83,8 @@ typedef struct
21  #endif
22     char *posting_host;                /* FQDN or NULL */
23     char *login_name;
24 +   char *user_agent;
25 +   char *system_type;
26  }
27  Slrn_User_Info_Type;
28  
29 diff -urNp -x '*.orig' slrn-1.0.3.org/src/post.c slrn-1.0.3/src/post.c
30 --- slrn-1.0.3.org/src/post.c   2016-10-24 00:34:16.000000000 +0200
31 +++ slrn-1.0.3/src/post.c       2021-10-03 22:48:59.187724986 +0200
32 @@ -662,9 +662,16 @@ static int prepare_header (VFILE *vp, un
33     int newsgroups_found=0, subject_found=0, followupto_found=0;
34     Slrn_Mime_Error_Obj *err=NULL;
35     Slrn_Mime_Error_Obj *mime_err;
36 -   char *tmp, *system_os_name;
37 +   char *tmp, *system_os_name, *User_Agent;
38  
39 +   if (Slrn_User_Info.system_type != NULL)
40 +     system_os_name = Slrn_User_Info.system_type;
41 +   else
42     system_os_name = slrn_get_os_name ();
43 +   if (Slrn_User_Info.user_agent != NULL)
44 +     User_Agent = Slrn_User_Info.user_agent;
45 +   else
46 +     User_Agent = "slrn";
47  
48  #if SLRN_HAS_STRICT_FROM
49     if (NULL != (tmp = slrn_make_from_header ()))
50 @@ -821,7 +828,7 @@ static int prepare_header (VFILE *vp, un
51  
52     if ((NULL == (tmp = slrn_gen_date_header ()))
53         || (NULL == slrn_append_to_header (a, tmp, 1))
54 -       || (NULL == (tmp = slrn_strdup_printf("User-Agent: slrn/%s (%s)", Slrn_Version_String, system_os_name)))
55 +       || (NULL == (tmp = slrn_strdup_printf("User-Agent: %s/%s (%s)", User_Agent, Slrn_Version_String, system_os_name)))
56         || (NULL == slrn_append_to_header (a, tmp, 1))
57         || (NULL == slrn_append_to_header (a, NULL,0)))   /* separator */
58       {
59 diff -urNp -x '*.orig' slrn-1.0.3.org/src/startup.c slrn-1.0.3/src/startup.c
60 --- slrn-1.0.3.org/src/startup.c        2016-10-24 00:34:16.000000000 +0200
61 +++ slrn-1.0.3/src/startup.c    2021-10-03 22:48:59.191058315 +0200
62 @@ -766,6 +766,8 @@ Slrn_Str_Var_Type Slrn_Str_Variables []
63       {"followup_custom_headers", &Slrn_Followup_Custom_Headers, NULL},
64       {"reply_custom_headers", &Slrn_Reply_Custom_Headers, NULL},
65       {"supersedes_custom_headers", &Slrn_Supersedes_Custom_Headers, NULL},
66 +     {"user_agent", &Slrn_User_Info.user_agent},
67 +     {"system_type", &Slrn_User_Info.system_type},
68  #if SLRN_HAS_GROUPLENS
69       {"grouplens_pseudoname", &Slrn_GroupLens_Pseudoname, NULL},
70       {"grouplens_host", &Slrn_GroupLens_Host, NULL},
This page took 0.077586 seconds and 3 git commands to generate.