111
This commit is contained in:
@@ -30,31 +30,34 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
|
||||
|
||||
//根据用户信息
|
||||
private Handler netHandler = new Handler();
|
||||
private Handler netHandler = null;
|
||||
private Context context;
|
||||
|
||||
private IMLoginManager(Context context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
|
||||
}
|
||||
|
||||
//新用戶是否送了禮物
|
||||
public boolean isNewUserGif(){
|
||||
return getBoolean(isNewUserGif,false);
|
||||
public boolean isNewUserGif() {
|
||||
return getBoolean(isNewUserGif, false);
|
||||
}
|
||||
|
||||
//是否是新用戶還沒有送禮物
|
||||
public void setNewUserGif(boolean t){
|
||||
put(isNewUserGif,t);
|
||||
public void setNewUserGif(boolean t) {
|
||||
put(isNewUserGif, t);
|
||||
}
|
||||
|
||||
// 是否新用户第一次進直播間
|
||||
public boolean isisNewUserOne(){
|
||||
return getBoolean(isNewUserOne,false);
|
||||
}
|
||||
//新用戶是否送了禮物
|
||||
public void setisNewUserOne(boolean t){
|
||||
put(isNewUserOne,t);
|
||||
public boolean isisNewUserOne() {
|
||||
return getBoolean(isNewUserOne, false);
|
||||
}
|
||||
|
||||
//新用戶是否送了禮物
|
||||
public void setisNewUserOne(boolean t) {
|
||||
put(isNewUserOne, t);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,6 +85,16 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已登录
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static boolean isLogin(Context context) {
|
||||
return null != get(context).getUserInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置已登录的用户信息
|
||||
*
|
||||
@@ -89,6 +102,19 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
*/
|
||||
public void setupLoginUser(@NonNull IMLoginModel model) {
|
||||
this.userInfo = model;
|
||||
if (netHandler == null) {
|
||||
netHandler = new Handler();
|
||||
}
|
||||
netHandler.post(isInstructorRunnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新请求管理员身份信息
|
||||
*/
|
||||
public void checkInstructor() {
|
||||
if (netHandler == null) {
|
||||
netHandler = new Handler();
|
||||
}
|
||||
netHandler.post(isInstructorRunnable);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -136,6 +137,7 @@ public class MessageIMManager {
|
||||
if ((message.getConversationType() == Conversation.ConversationType.SYSTEM) && (message.getContent() instanceof TextMessage)) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
String json = content.getContent();
|
||||
Log.e("getSystemForRongcloud", json);
|
||||
model = new Gson().fromJson(json, ImUserInfoModel.class);
|
||||
}
|
||||
if (message.getConversationType() == Conversation.ConversationType.SYSTEM && model != null && TextUtils.equals(model.getMethod(), "LivePK_UnreadCount")) {
|
||||
|
||||
Reference in New Issue
Block a user