forked from j62/ctbrec
Fix follow/unfollow for BongaCams
This commit is contained in:
parent
915be1d4fc
commit
970b9ab574
|
@ -273,7 +273,7 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
throw new IOException("Not logged in");
|
throw new IOException("Not logged in");
|
||||||
}
|
}
|
||||||
|
|
||||||
String url = getSite().getBaseUrl() + "/friend/add/" + getName();
|
String url = getSite().getBaseUrl() + "/follow/" + getName();
|
||||||
LOG.debug("Calling {}", url);
|
LOG.debug("Calling {}", url);
|
||||||
RequestBody body = new FormBody.Builder()
|
RequestBody body = new FormBody.Builder()
|
||||||
.add("src", "public-chat")
|
.add("src", "public-chat")
|
||||||
|
@ -332,7 +332,7 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
throw new IOException("Not logged in");
|
throw new IOException("Not logged in");
|
||||||
}
|
}
|
||||||
|
|
||||||
String url = getSite().getBaseUrl() + "/friend/ajax/remove/" + getName() + '/' + getUserId();
|
String url = getSite().getBaseUrl() + "/unfollow/" + getName() + '/' + getUserId();
|
||||||
LOG.debug("Calling {}", url);
|
LOG.debug("Calling {}", url);
|
||||||
RequestBody body = new FormBody.Builder()
|
RequestBody body = new FormBody.Builder()
|
||||||
.add("_csrf_token", getCsrfToken())
|
.add("_csrf_token", getCsrfToken())
|
||||||
|
@ -350,7 +350,7 @@ public class BongaCamsModel extends AbstractModel {
|
||||||
if (resp.isSuccessful()) {
|
if (resp.isSuccessful()) {
|
||||||
String msg = resp.body().string();
|
String msg = resp.body().string();
|
||||||
JSONObject json = new JSONObject(msg);
|
JSONObject json = new JSONObject(msg);
|
||||||
if (json.optString(STATUS).equals(SUCCESS)) {
|
if (json.optBoolean(SUCCESS)) {
|
||||||
LOG.debug("Follow/Unfollow -> {}", msg);
|
LOG.debug("Follow/Unfollow -> {}", msg);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue