about summary refs log tree commit diff
path: root/third_party/cgit/filters/email-gravatar.lua
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-05-19T08·27+0200
committersterni <sternenseemann@systemli.org>2022-05-19T08·45+0200
commit40803d9c6d1cf1acc286a40e400c8972ad5ce8d0 (patch)
tree5cd44d7e050af9ac4394d7d1ef64834ff7a6a852 /third_party/cgit/filters/email-gravatar.lua
parente579aa66030bde44f2b0f7d3031c08af0f7d3a3c (diff)
parent0c86e2ac3f20fa43fabd2f7ff2dc3d16fadd08e0 (diff)
subtree(3p/cgit): merge cgit-pink into depot cgit r/4094
cgit-pink is a maintained fork of cgit that follows upstream git more
closely and already contains a lot of patches we already had applied.
Consequently, it seems sensible it becomes our future upstream, we may
even be able to upstream some of our custom, less invasive patches.

Change-Id: Ia081e4508866f32298986c7160f4890c8a7c8922
Diffstat (limited to 'third_party/cgit/filters/email-gravatar.lua')
-rw-r--r--third_party/cgit/filters/email-gravatar.lua35
1 files changed, 0 insertions, 35 deletions
diff --git a/third_party/cgit/filters/email-gravatar.lua b/third_party/cgit/filters/email-gravatar.lua
deleted file mode 100644
index c39b490d6b..0000000000
--- a/third_party/cgit/filters/email-gravatar.lua
+++ /dev/null
@@ -1,35 +0,0 @@
--- This script may be used with the email-filter or repo.email-filter settings in cgitrc.
--- It adds gravatar icons to author names. It is designed to be used with the lua:
--- prefix in filters. It is much faster than the corresponding python script.
---
--- Requirements:
--- 	luaossl
--- 	<http://25thandclement.com/~william/projects/luaossl.html>
---
-
-local digest = require("openssl.digest")
-
-function md5_hex(input)
-	local b = digest.new("md5"):final(input)
-	local x = ""
-	for i = 1, #b do
-		x = x .. string.format("%.2x", string.byte(b, i))
-	end
-	return x
-end
-
-function filter_open(email, page)
-	buffer = ""
-	md5 = md5_hex(email:sub(2, -2):lower())
-end
-
-function filter_close()
-	html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer)
-	return 0
-end
-
-function filter_write(str)
-	buffer = buffer .. str
-end
-
-