Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ApiErrorCodeMap {
put(SealTalkUrl.REMOVE_BLACK_LIST, SealTalkUrlCode.REMOVE_BLACK_LIST);
put(SealTalkUrl.SET_NICK_NAME, SealTalkUrlCode.SET_NICK_NAME);
put(SealTalkUrl.SET_PORTRAIT, SealTalkUrlCode.SET_PORTRAIT);
put(SealTalkUrl.ARGEE_FRIENDS, SealTalkUrlCode.ARGEE_FRIENDS);
put(SealTalkUrl.AGREE_FRIENDS, SealTalkUrlCode.AGREE_FRIENDS);
put(SealTalkUrl.SET_DISPLAY_NAME, SealTalkUrlCode.SET_DISPLAY_NAME);
put(SealTalkUrl.INVITE_FRIEND, SealTalkUrlCode.INVITE_FRIEND);
put(SealTalkUrl.DELETE_FREIND, SealTalkUrlCode.DELETE_FREIND);
Expand Down
4 changes: 2 additions & 2 deletions sealtalk/src/main/java/cn/rongcloud/im/net/SealTalkUrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public class SealTalkUrl {

public static final String SET_PORTRAIT = "user/set_portrait_uri";

public static final String ARGEE_FRIENDS = "friendship/agree";
public static final String AGREE_FRIENDS = "friendship/agree";

public static final String INGORE_FRIENDS = "friendship/ignore";
public static final String IGNORE_FRIENDS = "friendship/ignore";

public static final String GET_FRIEND_PROFILE = "friendship/{friendId}/profile";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class SealTalkUrlCode {

public static final int SET_PORTRAIT = 32 * API_CODE_PREFIX;

public static final int ARGEE_FRIENDS = 33 * API_CODE_PREFIX;
public static final int AGREE_FRIENDS = 33 * API_CODE_PREFIX;

public static final int GET_FRIEND_PROFILE = 34 * API_CODE_PREFIX;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ public interface FriendService {
*
* @return
*/
@POST(SealTalkUrl.ARGEE_FRIENDS)
@POST(SealTalkUrl.AGREE_FRIENDS)
LiveData<Result<Boolean>> agreeFriend(@Body RequestBody body);

/**
* 忽略好友请求
*
* @return
*/
@POST(SealTalkUrl.INGORE_FRIENDS)
LiveData<Result<Void>> ingoreFriend(@Body RequestBody body);
@POST(SealTalkUrl.IGNORE_FRIENDS)
LiveData<Result<Void>> ignoreFriend(@Body RequestBody body);

/**
* 设置好友备注名
Expand Down
5 changes: 2 additions & 3 deletions sealtalk/src/main/java/cn/rongcloud/im/task/FriendTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import cn.rongcloud.im.utils.RongGenerate;
import cn.rongcloud.im.utils.SearchUtils;
import cn.rongcloud.im.utils.log.SLog;
import io.rong.imkit.userinfo.RongUserInfoManager;
import io.rong.imlib.model.Conversation;
import okhttp3.RequestBody;

Expand Down Expand Up @@ -271,7 +270,7 @@ protected LiveData<Result<Boolean>> createCall() {
* @param friendId
* @return
*/
public LiveData<Resource<Void>> ingore(String friendId) {
public LiveData<Resource<Void>> ignore(String friendId) {
return new NetworkOnlyResource<Void, Result<Void>>() {

@NonNull
Expand All @@ -280,7 +279,7 @@ protected LiveData<Result<Void>> createCall() {
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("friendId", friendId);
RequestBody body = RetrofitUtil.createJsonRequest(paramsMap);
return friendService.ingoreFriend(body);
return friendService.ignoreFriend(body);
}
}.asLiveData();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class GroupNoticeListActivity extends TitleBaseActivity {
private GroupNoticeListAdapter adapter;
private List<String> showIdList = new ArrayList<>();
private Map<String, String> portraitUrlMap = new HashMap<>();
private boolean isCanClickIngore = true;
private boolean isCanClickIgnore = true;
private boolean isCanClickAgree = true;


Expand Down Expand Up @@ -128,10 +128,10 @@ public boolean onButtonIgnoreClick(View view, int position, GroupNoticeInfo info
return false;
}
if (info.getStatus() == 2) {
if (!isCanClickIngore) {
if (!isCanClickIgnore) {
return false;
}
isCanClickIngore = false;
isCanClickIgnore = false;
//状态码0表示忽略
LiveData<Resource<Void>> setStatusResult = groupNoticeInfoViewModel.setGroupNoticeStatus(info.getGroupId(), info.getReceiverId(),
"0", info.getId());
Expand All @@ -141,10 +141,10 @@ public void onChanged(Resource<Void> voidResource) {
if (voidResource.status == Status.SUCCESS) {
setStatusResult.removeObserver(this);
ToastUtils.showToast(getString(R.string.seal_group_notice_success));
isCanClickIngore = true;
isCanClickIgnore = true;
} else if (voidResource.status == Status.ERROR) {
setStatusResult.removeObserver(this);
isCanClickIngore = true;
isCanClickIgnore = true;
ToastUtils.showToast(getString(R.string.common_network_unavailable));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void onChanged(Resource<Boolean> resource) {
}
});

newFriendViewModel.getIngoreResult().observe(this, new Observer<Resource<Void>>() {
newFriendViewModel.getIgnoreResult().observe(this, new Observer<Resource<Void>>() {
@Override
public void onChanged(Resource<Void> voidResource) {

Expand All @@ -145,7 +145,7 @@ private void agreeFriends(String friendId) {
*/
private void ignoreFriends(String friendId) {
if (newFriendViewModel != null) {
newFriendViewModel.ingore(friendId);
newFriendViewModel.ignore(friendId);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import androidx.arch.core.util.Function;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MediatorLiveData;
import androidx.lifecycle.Observer;

import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -27,7 +25,7 @@ public class NewFriendViewModel extends AndroidViewModel {

private SingleSourceMapLiveData<Resource<Boolean>,Resource<Boolean>> agreeResult;

private SingleSourceMapLiveData<Resource<Void>,Resource<Void>> ingoreResult;
private SingleSourceMapLiveData<Resource<Void>,Resource<Void>> ignoreResult;

private FriendTask friendTask ;
public NewFriendViewModel(@NonNull Application application) {
Expand Down Expand Up @@ -70,7 +68,7 @@ public int compare(FriendShipInfo lhs, FriendShipInfo rhs) {
return resource;
});

ingoreResult = new SingleSourceMapLiveData<>(resource -> {
ignoreResult = new SingleSourceMapLiveData<>(resource -> {
if(resource.status == Status.SUCCESS){
// 成功之后刷新列表
getFriendsAllData();
Expand Down Expand Up @@ -117,14 +115,14 @@ public void agree(String friendId) {
* 忽略好友请求结果
* @return
*/
public LiveData<Resource<Void>> getIngoreResult() {
return ingoreResult;
public LiveData<Resource<Void>> getIgnoreResult() {
return ignoreResult;
}

/**
* 忽略好友请求
* @param friendId
*/
public void ingore(String friendId) {
ingoreResult.setSource(friendTask.ingore(friendId));}
public void ignore(String friendId) {
ignoreResult.setSource(friendTask.ignore(friendId));}
}