@@ -4,12 +4,12 @@ string trelloAPIURL = "https://api.trello.com";
44string trelloSecret, trelloAuth;
55
66import dlangbot.bugzilla : Issue, IssueRef;
7+ import dlangbot.utils : request;
78import std.algorithm , std.range ;
89import std.format : format;
910
1011import vibe.core.log ;
1112import vibe.data.json;
12- import vibe.http.client : requestHTTP;
1313import vibe.http.common : HTTPMethod;
1414import vibe.stream.operations : readAllUTF8;
1515
@@ -20,7 +20,7 @@ import vibe.stream.operations : readAllUTF8;
2020void trelloSendRequest (T... )(HTTPMethod method, string url, T arg)
2121 if (T.length <= 1 )
2222{
23- requestHTTP (url, (scope req) {
23+ request (url, (scope req) {
2424 req.method = method;
2525 static if (T.length)
2626 req.writeJsonBody(arg);
@@ -29,7 +29,7 @@ void trelloSendRequest(T...)(HTTPMethod method, string url, T arg)
2929 logInfo(" %s %s: %s\n " , method, url.replace(trelloAuth, " key=[hidden]&token=[hidden]" )
3030 , res.statusPhrase);
3131 else
32- logWarn (" %s %s: %s %s.\n %s" , method, url.replace(trelloAuth, " key=[hidden]&token=[hidden]" ),
32+ logError (" %s %s: %s %s.\n %s" , method, url.replace(trelloAuth, " key=[hidden]&token=[hidden]" ),
3333 res.statusPhrase, res.statusCode, res.bodyReader.readAllUTF8);
3434 });
3535}
@@ -79,7 +79,7 @@ auto findTrelloCards(int issueID)
7979{
8080
8181 return trelloAPI (" /1/search?query=name:\" Issue %d\" " , issueID)
82- .requestHTTP
82+ .request
8383 .readJson[" cards" ][]
8484 .map! (c => TrelloCard(c[" id" ].get ! string , issueID));
8585}
@@ -89,7 +89,7 @@ struct Comment { string url, body_; }
8989Comment getTrelloBotComment (string cardID)
9090{
9191 auto res = trelloAPI(" /1/cards/%s/actions?filter=commentCard" , cardID)
92- .requestHTTP
92+ .request
9393 .readJson[]
9494 .find! (c => c[" memberCreator" ][" username" ] == " dlangbot" );
9595 if (res.length)
@@ -102,10 +102,10 @@ Comment getTrelloBotComment(string cardID)
102102void moveCardToList (string cardID, string listName)
103103{
104104 auto card = trelloAPI(" /1/cards/%s" , cardID)
105- .requestHTTP
105+ .request
106106 .readJson;
107107 auto lists = trelloAPI(" /1/board/%s/lists" , card[" idBoard" ].get ! string )
108- .requestHTTP
108+ .request
109109 .readJson[];
110110
111111 immutable curListName = lists.find! (c => c[" id" ].get ! string == card[" idList" ].get ! string )
0 commit comments