|
|
@@ -273,7 +273,7 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
addDefaultRequest(request);
|
|
|
}
|
|
|
|
|
|
- private void updateUI(MucRoom mucRoom) {
|
|
|
+ private void updateUI(final MucRoom mucRoom) {
|
|
|
List<Notice> notices = mucRoom.getNotices();
|
|
|
if (notices != null && !notices.isEmpty()) {
|
|
|
String text = notices.get(0).getText();
|
|
|
@@ -317,9 +317,6 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
if (my != null) {// 将我自己移动到第一个的位置
|
|
|
mMembers.remove(my);
|
|
|
@@ -405,12 +402,7 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
mAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
});
|
|
|
- findViewById(R.id.banned_delete_rl).setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {//删除群房间
|
|
|
- deleteRoom(mRoom);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
//TODO 处理群消息屏蔽事件
|
|
|
findViewById(R.id.shield_chat_rl).setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
@@ -434,7 +426,6 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
btnExit = (Button) findViewById(R.id.btn_exit);
|
|
|
}
|
|
|
btnExit.setText("退出商务群");
|
|
|
-
|
|
|
add_manage_rl.setVisibility(View.GONE);
|
|
|
remove_manage_rl.setVisibility(View.GONE);
|
|
|
findViewById(R.id.room_name_arrow_img).setVisibility(View.INVISIBLE);
|
|
|
@@ -460,19 +451,16 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
btnExit.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
- deleteRoom(mRoom);
|
|
|
- }
|
|
|
- });
|
|
|
- findViewById(R.id.exit_room_rl).setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {//成员退出房间
|
|
|
- deleteRoom(mRoom);
|
|
|
+ deleteRoom(mucRoom);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
findViewById(R.id.nick_name_rl).setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
@@ -634,10 +622,8 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
|
if (mucRoomMember.getRole() == 3) {
|
|
|
- Log.i("gongpengming", "getRole() == 3");
|
|
|
mucRoomMember.setRole(2);
|
|
|
} else {
|
|
|
- Log.i("gongpengming", "getRole() == 2");
|
|
|
mucRoomMember.setRole(3);
|
|
|
}
|
|
|
}
|
|
|
@@ -921,55 +907,13 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
addDefaultRequest(request);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @desc:删除房间
|
|
|
- * @author:Administrator on 2016/3/23 10:47
|
|
|
- */
|
|
|
- @Deprecated
|
|
|
- public void deleteRoom() {
|
|
|
- HashMap<String, String> params = new HashMap<String, String>();
|
|
|
- params.put("access_token", MyApplication.getInstance().mAccessToken);
|
|
|
- params.put("roomId", mRoom.getRoomId());
|
|
|
- final ProgressDialog dialog = ProgressDialogUtil.init(mContext, null, getString(R.string.please_wait));
|
|
|
- ProgressDialogUtil.show(dialog);
|
|
|
-
|
|
|
- StringJsonObjectRequest<Void> request = new StringJsonObjectRequest<Void>(mConfig.ROOM_DELETE, new ErrorListener() {
|
|
|
- @Override
|
|
|
- public void onErrorResponse(VolleyError arg0) {
|
|
|
- ToastUtil.showErrorNet(mContext);
|
|
|
- ProgressDialogUtil.dismiss(dialog);
|
|
|
- }
|
|
|
- }, new Listener<Void>() {
|
|
|
- @Override
|
|
|
- public void onResponse(ObjectResult<Void> result) {
|
|
|
- ProgressDialogUtil.dismiss(dialog);
|
|
|
-
|
|
|
- boolean success = Result.defaultParser(mContext, result, true);
|
|
|
- if (success) {
|
|
|
- ToastUtil.showToast(RoomInfoActivity.this, "删除房间成功!");
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- startActivity(new Intent(RoomInfoActivity.this, CommonFragmentActivity.class));
|
|
|
- //删除数据库中的房间
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }, Void.class, params);
|
|
|
- addDefaultRequest(request);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
//删除
|
|
|
- private void deleteRoom(final Friend sortFriend) {
|
|
|
+ private void deleteRoom(final MucRoom sortFriend) {
|
|
|
//根据mLoginuerId获取or_id,删除群需要去更新erp服务器数据
|
|
|
final int or_id = getOr_id();
|
|
|
-
|
|
|
boolean deleteRoom = false;
|
|
|
- if (mLoginUserId.equals(sortFriend.getRoomCreateUserId())) {
|
|
|
+ if (mLoginUserId.equals(sortFriend.getUserId())) {
|
|
|
+ //我是群主
|
|
|
deleteRoom = true;
|
|
|
}
|
|
|
String url = null;
|
|
|
@@ -979,15 +923,15 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
url = MyApplication.getInstance().getConfig().ROOM_MEMBER_DELETE;
|
|
|
}
|
|
|
HashMap<String, String> params = new HashMap<String, String>();
|
|
|
-
|
|
|
params.put("access_token", MyApplication.getInstance().mAccessToken);
|
|
|
- params.put("roomId", sortFriend.getRoomId());
|
|
|
+ params.put("roomId", sortFriend.getId());
|
|
|
if (!deleteRoom) {
|
|
|
params.put("userId", mLoginUserId);
|
|
|
}
|
|
|
|
|
|
final ProgressDialog dialog = ProgressDialogUtil.init(this, null, getString(R.string.please_wait));
|
|
|
ProgressDialogUtil.show(dialog);
|
|
|
+
|
|
|
StringJsonObjectRequest<Void> request = new StringJsonObjectRequest<Void>(url, new ErrorListener() {
|
|
|
@Override
|
|
|
public void onErrorResponse(VolleyError arg0) {
|
|
|
@@ -999,7 +943,7 @@ public class RoomInfoActivity extends BaseActivity {
|
|
|
public void onResponse(ObjectResult<Void> result) {
|
|
|
boolean success = Result.defaultParser(RoomInfoActivity.this, result, true);
|
|
|
if (success) {
|
|
|
- deleteFriend(sortFriend);
|
|
|
+ deleteFriend(mRoom);
|
|
|
updateCreateFalgToERP(or_id);
|
|
|
}
|
|
|
ProgressDialogUtil.dismiss(dialog);
|