diff options
author | June McEnroe | 2021-01-20 13:33:37 -0500 |
---|---|---|
committer | June McEnroe | 2022-02-13 18:24:04 -0500 |
commit | d993e4be6731b1a806e2c7588334a3f485a5fd31 (patch) | |
tree | 3d6276d4a791560a48d9481c31b9e7eba9fcc2a6 /filters/email-gravatar.lua | |
parent | Merge remote-tracking branch 'ch/git-2-35' (diff) | |
download | cgit-d993e4be6731b1a806e2c7588334a3f485a5fd31.tar.gz cgit-d993e4be6731b1a806e2c7588334a3f485a5fd31.zip |
Remove Lua support
Lua support is unused and the dlsym fwrite/write hacks horrify me. Clean it up.
Diffstat (limited to 'filters/email-gravatar.lua')
-rw-r--r-- | filters/email-gravatar.lua | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/filters/email-gravatar.lua b/filters/email-gravatar.lua deleted file mode 100644 index c39b490..0000000 --- a/filters/email-gravatar.lua +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | -- This script may be used with the email-filter or repo.email-filter settings in cgitrc. | ||
2 | -- It adds gravatar icons to author names. It is designed to be used with the lua: | ||
3 | -- prefix in filters. It is much faster than the corresponding python script. | ||
4 | -- | ||
5 | -- Requirements: | ||
6 | -- luaossl | ||
7 | -- <http://25thandclement.com/~william/projects/luaossl.html> | ||
8 | -- | ||
9 | |||
10 | local digest = require("openssl.digest") | ||
11 | |||
12 | function md5_hex(input) | ||
13 | local b = digest.new("md5"):final(input) | ||
14 | local x = "" | ||
15 | for i = 1, #b do | ||
16 | x = x .. string.format("%.2x", string.byte(b, i)) | ||
17 | end | ||
18 | return x | ||
19 | end | ||
20 | |||
21 | function filter_open(email, page) | ||
22 | buffer = "" | ||
23 | md5 = md5_hex(email:sub(2, -2):lower()) | ||
24 | end | ||
25 | |||
26 | function filter_close() | ||
27 | html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer) | ||
28 | return 0 | ||
29 | end | ||
30 | |||
31 | function filter_write(str) | ||
32 | buffer = buffer .. str | ||
33 | end | ||
34 | |||
35 | |||