新增新用户注册后FirebaseAnalytics.logEvent调用
尝试修复美颜会闪屏问题(待观察) 修复跨机子设置备注不显示在列表上的问题 修复聊天列表会出现PK消息的问题
This commit is contained in:
@@ -1226,46 +1226,46 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
if (obj != null) {
|
||||
if (obj.getString("ispk").equals("0")) {
|
||||
final SocketSendBean msg1 = new SocketSendBean()
|
||||
.param("_method_", SOCKET_LINK_MIC_PK)
|
||||
.param("action", 1)
|
||||
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||
.param("pkuid", pkUid)
|
||||
.param("uid", CommonAppConfig.getInstance().getUid())
|
||||
.param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("uhead", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||
//判断是否是随机PK
|
||||
if(extra){
|
||||
msg1.param("random_pk", "1");
|
||||
msg1.param("msgtype","11");
|
||||
if (RandomPkManager.getInstance().isRankModel()) {
|
||||
msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png");
|
||||
}
|
||||
final SocketSendBean msg1 = new SocketSendBean()
|
||||
.param("_method_", SOCKET_LINK_MIC_PK)
|
||||
.param("action", 1)
|
||||
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||
.param("pkuid", pkUid)
|
||||
.param("uid", CommonAppConfig.getInstance().getUid())
|
||||
.param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("uhead", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||
.param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||
//判断是否是随机PK
|
||||
if(extra){
|
||||
msg1.param("random_pk", "1");
|
||||
msg1.param("msgtype","11");
|
||||
if (RandomPkManager.getInstance().isRankModel()) {
|
||||
msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png");
|
||||
}
|
||||
msg1.create();
|
||||
}
|
||||
msg1.create();
|
||||
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + pkUid, conversationType, messageContent);
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + pkUid, conversationType, messageContent);
|
||||
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||
@Override
|
||||
public void onAttached(io.rong.imlib.model.Message message) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||
Log.e("tx", "发送成功");
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||
Log.e("tx", "发送成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||
Log.e("tx", "发送失败" + errorCode.getMessage());
|
||||
@Override
|
||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||
Log.e("tx", "发送失败" + errorCode.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtil.show(mContext.getString(R.string.pking_over));
|
||||
if (RandomPkManager.getInstance().isRandomModel()) {
|
||||
|
||||
@@ -29,9 +29,11 @@ import com.yunbao.live.event.InputPanelViewHolderEvent;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.common.RLog;
|
||||
import io.rong.imkit.R.string;
|
||||
@@ -41,7 +43,11 @@ import io.rong.imkit.utils.language.LangUtils;
|
||||
import io.rong.imkit.utils.language.RongConfigurationManager;
|
||||
import io.rong.imkit.widget.adapter.IViewProviderListener;
|
||||
import io.rong.imkit.widget.adapter.ViewHolder;
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
import io.rong.imlib.RongCoreClient;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
import io.rong.imlib.model.MessageContent;
|
||||
|
||||
@@ -64,6 +70,43 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
super(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataCollection(List<UiMessage> data) {
|
||||
List<UiMessage> list = new ArrayList<>();
|
||||
for (UiMessage datum : data) {
|
||||
try {
|
||||
String content = datum.getMessage().getContent().toString();
|
||||
if (content.contains("retcode") && content.contains("_method_")) {
|
||||
delMessage(datum.getTargetId(), datum.getMessage());
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
list.add(datum);
|
||||
}
|
||||
super.setDataCollection(list);
|
||||
}
|
||||
|
||||
private void delMessage(String targetId, Message msg) {
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
Message[] messages = {msg};
|
||||
RongCoreClient.getInstance().deleteRemoteMessages(conversationType, targetId, messages, new IRongCoreCallback.OperationCallback() {
|
||||
/**
|
||||
* 删除消息成功回调
|
||||
*/
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
super.onBindViewHolder(holder, position);
|
||||
|
||||
Reference in New Issue
Block a user