openidec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit eb0358d04ad9809df490af9be06c37c2274fe0f8
parent 2a2b57bf2848330e9ae17b338899c24f0b3b81ea
Author: Peter Kosyh <p.kosyh@gmail.com>
Date:   Sat, 30 Jan 2021 11:43:05 +0300

echo+topics query

Diffstat:
Mii-node/web.go | 5++++-
Mii/db.go | 6+++++-
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ii-node/web.go b/ii-node/web.go @@ -981,7 +981,7 @@ func _handleWWW(ctx *WebContext, w http.ResponseWriter, r *http.Request) error { } ctx.BasePath = "from/" + args[1] return www_query(ctx, w, r, ii.Query{From: args[1]}, page, rss) - } else if args[0] == "echo" { + } else if args[0] == "echo" || args[0] == "echo+topics" { page := 1 rss := false if len(args) < 2 { @@ -1000,6 +1000,9 @@ func _handleWWW(ctx *WebContext, w http.ResponseWriter, r *http.Request) error { } ctx.Echo = q.Echo q.Start = -PAGE_SIZE + if args[0] == "echo+topics" { + q.Repto = "!" + } ctx.BasePath = "echo/" + args[1] return www_query(ctx, w, r, q, page, rss) } else if ii.IsEcho(args[0]) { diff --git a/ii/db.go b/ii/db.go @@ -491,7 +491,11 @@ func (db *DB) Match(info MsgInfo, r Query) bool { if r.Echo != "" && r.Echo != info.Echo { return false } - if r.Repto != "" && r.Repto != info.Repto { + if r.Repto == "!" { + if info.Repto != "" { + return false + } + } else if r.Repto != "" && r.Repto != info.Repto { return false } if r.To != "" && r.To != info.To {