~emersion/hut

344337b8246c51f79f2f9c8f3eb6ae2bd663a1f0 — Simon Ser 5 months ago 4b6943c
export/lists: add visibility
3 files changed, 7 insertions(+), 4 deletions(-)

M export/lists.go
M srht/listssrht/gql.go
M srht/listssrht/operations.graphql
M export/lists.go => export/lists.go +5 -3
@@ 39,9 39,10 @@ func NewListsExporter(client *gqlclient.Client, http *http.Client) *ListsExporte
// export (i.e. the ones filled in by the GraphQL query)
type MailingListInfo struct {
	Info
	Description *string  `json:"description"`
	PermitMime  []string `json:"permitMime"`
	RejectMime  []string `json:"rejectMime"`
	Description *string              `json:"description"`
	Visibility  listssrht.Visibility `json:"visibility"`
	PermitMime  []string             `json:"permitMime"`
	RejectMime  []string             `json:"rejectMime"`
}

func (ex *ListsExporter) Export(ctx context.Context, dir string) error {


@@ 118,6 119,7 @@ func (ex *ListsExporter) exportList(ctx context.Context, list listssrht.MailingL
			Name:    list.Name,
		},
		Description: list.Description,
		Visibility:  list.Visibility,
		PermitMime:  list.PermitMime,
		RejectMime:  list.RejectMime,
	}

M srht/listssrht/gql.go => srht/listssrht/gql.go +1 -1
@@ 728,7 728,7 @@ func MailingLists(client *gqlclient.Client, ctx context.Context, cursor *Cursor)
}

func ExportMailingLists(client *gqlclient.Client, ctx context.Context, cursor *Cursor) (me *User, err error) {
	op := gqlclient.NewOperation("query exportMailingLists ($cursor: Cursor) {\n\tme {\n\t\tlists(cursor: $cursor) {\n\t\t\tresults {\n\t\t\t\tname\n\t\t\t\tdescription\n\t\t\t\tpermitMime\n\t\t\t\trejectMime\n\t\t\t\tarchive\n\t\t\t}\n\t\t\tcursor\n\t\t}\n\t}\n}\n")
	op := gqlclient.NewOperation("query exportMailingLists ($cursor: Cursor) {\n\tme {\n\t\tlists(cursor: $cursor) {\n\t\t\tresults {\n\t\t\t\tname\n\t\t\t\tdescription\n\t\t\t\tvisibility\n\t\t\t\tpermitMime\n\t\t\t\trejectMime\n\t\t\t\tarchive\n\t\t\t}\n\t\t\tcursor\n\t\t}\n\t}\n}\n")
	op.Var("cursor", cursor)
	var respData struct {
		Me *User

M srht/listssrht/operations.graphql => srht/listssrht/operations.graphql +1 -0
@@ 18,6 18,7 @@ query exportMailingLists($cursor: Cursor) {
            results {
                name
                description
                visibility
                permitMime
                rejectMime
                archive