summary refs log tree commit diff stats
path: root/query.go
diff options
context:
space:
mode:
Diffstat (limited to 'query.go')
-rw-r--r--query.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/query.go b/query.go
index c47cfb0..156ccda 100644
--- a/query.go
+++ b/query.go
@@ -55,19 +55,23 @@ func apiEndpointQuery(w http.ResponseWriter, r *http.Request) error {
 	// something went very wrong.
 	switch endpoint {
 	case "users":
-		if urls != "" {
-			out2, err = twtxtCache.QueryUser(urls)
+		if query != "" {
+			out2, err = twtxtCache.QueryUser(query)
 			out = append(out, out2...)
 			apiErrCheck(err, r)
 		}
-		if query != "" {
-			out2, err = twtxtCache.QueryUser(query)
+		if urls != "" {
+			out2, err = twtxtCache.QueryUser(urls)
 			out = append(out, out2...)
 			apiErrCheck(err, r)
 		}
 
 	case "mentions":
-		out, err = twtxtCache.QueryInStatus(query)
+		if urls == "" {
+			return fmt.Errorf("missing URL in mention query")
+		}
+		urls += ">"
+		out, err = twtxtCache.QueryInStatus(urls)
 		apiErrCheck(err, r)
 
 	case "tweets":