Skip to content

Commit deb573e

Browse files
committed
via名が”iMast”だったらwebsiteを付与するように
1 parent 585d806 commit deb573e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

iMast/MastodonAPI.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,15 @@ public class MastodonInstance {
7676

7777
func createApp(name: String = "iMast", redirect_uri:String = "imast://callback/") -> Promise<MastodonApp> {
7878
return Promise<MastodonApp> { resolve, reject in
79-
Alamofire.request("https://"+self.hostName+"/api/v1/apps", method: .post, parameters: [
79+
var params = [
8080
"client_name": name,
8181
"scopes": "read write follow",
8282
"redirect_uris": redirect_uri,
83-
]).responseJSON { res in
83+
]
84+
if name == "iMast" {
85+
params["website"] = "https://cinderella-project.github.io/iMast/"
86+
}
87+
Alamofire.request("https://"+self.hostName+"/api/v1/apps", method: .post, parameters: params).responseJSON { res in
8488
if res.error != nil {
8589
reject(res.error!)
8690
return

0 commit comments

Comments
 (0)