add reveal secrets in mod stream
This commit is contained in:
parent
59068bb961
commit
67e0f259b6
@ -81,6 +81,9 @@ type PostModel interface {
|
||||
// returns true if this post was truncated
|
||||
IsTruncated() bool
|
||||
|
||||
// return true if this post is a mod message
|
||||
IsCtl() bool
|
||||
|
||||
IsI2P() bool
|
||||
IsTor() bool
|
||||
IsClearnet() bool
|
||||
@ -244,7 +247,6 @@ func (self boardPageRows) Swap(i, j int) {
|
||||
self[i], self[j] = self[j], self[i]
|
||||
}
|
||||
|
||||
|
||||
type postsGraphRow struct {
|
||||
day time.Time
|
||||
Num int64
|
||||
|
@ -297,6 +297,10 @@ type post struct {
|
||||
FrontendPublicKey string
|
||||
}
|
||||
|
||||
func (p *post) IsCtl() bool {
|
||||
return p.board == "ctl"
|
||||
}
|
||||
|
||||
func (self *post) NNTPID() int {
|
||||
return self.nntp_id
|
||||
}
|
||||
|
@ -16,6 +16,29 @@ var nntpchan_mod_mark_spam = function(longhash) {
|
||||
elem.innerText = "spam";
|
||||
};
|
||||
|
||||
var nntpchan_mod_decode_ipban = function(longhash) {
|
||||
var elem = document.getElementById("post_body_" + longhash);
|
||||
if(!elem) return;
|
||||
var lines = elem.inenrText.split("\n");
|
||||
for(var i = 0; i < lines.length; ++i)
|
||||
{
|
||||
if (!lines[idx].startsWith("overchan-inet-ban"))
|
||||
continue;
|
||||
var parts = lines[idx].split(" ");
|
||||
if(parts.length != 2) continue;
|
||||
parts = parts[1].split(":");
|
||||
if(parts.legngth < 2) continue;
|
||||
var a1 = atob(parts[0]);
|
||||
var a2 = atob(parts[1]);
|
||||
var txt = "";
|
||||
for(var idx = 0; idx < a1.length; ++idx)
|
||||
{
|
||||
txt += String.fromCharCode(a1.charCodeAt(idx) ^ a2.charCodeAt(idx));
|
||||
}
|
||||
elem.appendChild(document.createTextNode(txt + "\n"));
|
||||
}
|
||||
};
|
||||
|
||||
var nntpchan_mod_commit_spam = function(elem) {
|
||||
var formdata = new FormData();
|
||||
var posts = document.getElementsByClassName("post");
|
||||
|
@ -32,10 +32,13 @@
|
||||
{{/post.Attachments}}
|
||||
<a href="#" onclick="nntpchan_mod_delete('{{post.PostHash}}');">[Delete]</a>
|
||||
<a href="#" onclick="nntpchan_mod_mark_spam('{{post.PostHash}}');">[Spam]</a>
|
||||
{{#post.IsCtl}}
|
||||
<a href="#" onclick="nntpchan_mod_decode_ipban('{{post.PostHash}}');">[Decode Secrets]</a>
|
||||
{{/post.IsCtl}}
|
||||
<a name="{{post.PostHash}}"></a><span class="topicline"><b data-subject="{{post.Subject}}" class="subject">{{post.Subject}}</b> {{post.Name}} <span class="published">{{post.Frontend}} || {{post.Date}}</span> {{{post.Pubkey}}} <a href="{{post.PostURL}}">[Reply]</a>
|
||||
<a href="#" onclick="return quickreply('{{post.ShortHash}}', '{{post.PostHash}}', '{{post.PostURL}}');"> {{post.ShortHash}}</a>
|
||||
</span>
|
||||
<br /><br />
|
||||
<span class="message_span">{{{post.RenderBody}}}</span>
|
||||
<span id="post_body_{{post.PostHash}}" class="message_span">{{{post.RenderBody}}}</span>
|
||||
<br style="clear: both;" />
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user