@@ 5,6 5,7 @@ import (
"strings"
"git.xenrox.net/~xenrox/srhtctl/config"
+ "git.xenrox.net/~xenrox/srhtctl/helpers"
)
// ListName is the name of a mailing list
@@ 118,7 119,13 @@ func PrintPatchsets(args []string) error {
}
func getPatchsets(response *patchPagerStruct, listName string) error {
- url := fmt.Sprintf("%s/api/lists/%s/patchsets", config.GetURL("lists"), listName)
+ var url string
+ if UserName != "" {
+ url = fmt.Sprintf("%s/api/user/%s/lists/%s/patchsets", config.GetURL("lists"),
+ helpers.TransformCanonical(UserName), listName)
+ } else {
+ url = fmt.Sprintf("%s/api/lists/%s/patchsets", config.GetURL("lists"), listName)
+ }
err := Request(url, "GET", "", &response)
if err != nil {
return err
@@ 127,7 134,13 @@ func getPatchsets(response *patchPagerStruct, listName string) error {
}
func getLists(response *listsPagerStruct) error {
- url := fmt.Sprintf("%s/api/lists", config.GetURL("lists"))
+ var url string
+ if UserName != "" {
+ url = fmt.Sprintf("%s/api/user/%s/lists", config.GetURL("lists"),
+ helpers.TransformCanonical(UserName))
+ } else {
+ url = fmt.Sprintf("%s/api/lists", config.GetURL("lists"))
+ }
err := Request(url, "GET", "", &response)
if err != nil {
return err