]>
Commit | Line | Data |
---|---|---|
33957255 JR |
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 | |
1a161ab5 JB |
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); | |
33957255 JR |
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 | |
8741f94d | 21 | #endif |
1a161ab5 JB |
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 | ||
33957255 JR |
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 | |
3591afbc JB |
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; | |
bbe6f716 | 38 | |
bbe6f716 JB |
39 | + if (Slrn_User_Info.system_type != NULL) |
40 | + system_os_name = Slrn_User_Info.system_type; | |
41 | + else | |
3591afbc | 42 | system_os_name = slrn_get_os_name (); |
bbe6f716 JB |
43 | + if (Slrn_User_Info.user_agent != NULL) |
44 | + User_Agent = Slrn_User_Info.user_agent; | |
45 | + else | |
46 | + User_Agent = "slrn"; | |
47 | ||
3591afbc | 48 | #if SLRN_HAS_STRICT_FROM |
33957255 JR |
49 | if (NULL != (tmp = slrn_make_from_header ())) |
50 | @@ -821,7 +828,7 @@ static int prepare_header (VFILE *vp, un | |
bbe6f716 | 51 | |
3591afbc JB |
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 | { | |
33957255 JR |
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 [] | |
3591afbc JB |
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}, | |
1a161ab5 JB |
66 | + {"user_agent", &Slrn_User_Info.user_agent}, |
67 | + {"system_type", &Slrn_User_Info.system_type}, | |
68 | #if SLRN_HAS_GROUPLENS | |
3591afbc JB |
69 | {"grouplens_pseudoname", &Slrn_GroupLens_Pseudoname, NULL}, |
70 | {"grouplens_host", &Slrn_GroupLens_Host, NULL}, |