Commit b38b31c0a770dbba53dff26f784199945c0381c8
1 parent
05cf7b9e
修改私聊逻辑
Showing
1 changed file
with
9 additions
and
3 deletions
app/src/main/java/com/cnlive/im/ui/PrivateChatActivity.java
| ... | ... | @@ -53,7 +53,7 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli |
| 53 | 53 | private EditText opposite_name_edit; |
| 54 | 54 | private String user_name_string; |
| 55 | 55 | private String user_id_string; |
| 56 | - private int sendInfo = 1; | |
| 56 | + private int sendInfo = 3; | |
| 57 | 57 | private Button agree_btn; |
| 58 | 58 | private Button reject_btn; |
| 59 | 59 | private LinearLayout agree_reject_lin; |
| ... | ... | @@ -109,8 +109,12 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli |
| 109 | 109 | } else if (sendInfo == 4) { |
| 110 | 110 | Toast.makeText(this, "对方已经拒绝不能发送", Toast.LENGTH_SHORT).show(); |
| 111 | 111 | |
| 112 | - } else { | |
| 113 | - | |
| 112 | + } else if (sendInfo == 3) { | |
| 113 | + Toast.makeText(this, "还没有邀请对方呦~", Toast.LENGTH_SHORT).show(); | |
| 114 | + } | |
| 115 | + else if (sendInfo == 5) { | |
| 116 | + Toast.makeText(this, "你已经拒绝对方不能发送消息", Toast.LENGTH_SHORT).show(); | |
| 117 | + }else { | |
| 114 | 118 | if (messageContent.getText().toString().isEmpty()) { |
| 115 | 119 | Toast.makeText(this, "不能发送空消息呦~", Toast.LENGTH_SHORT).show(); |
| 116 | 120 | } else { |
| ... | ... | @@ -216,7 +220,9 @@ public class PrivateChatActivity extends AppCompatActivity implements View.OnCli |
| 216 | 220 | sendInfo = 2; |
| 217 | 221 | Toast.makeText(PrivateChatActivity.this, "申请已发送等待对方验证", Toast.LENGTH_SHORT).show(); |
| 218 | 222 | } else if ("3".equals(type) && message.equals("拒绝")) { |
| 223 | + sendInfo=5; | |
| 219 | 224 | } else if ("3".equals(type) && message.equals("同意")) { |
| 225 | + sendInfo=1; | |
| 220 | 226 | } else if ("4".equals(type)) { |
| 221 | 227 | messageList.add(new ChatRoomActivity.CNMessageInfo(cnMessage, true)); |
| 222 | 228 | chatListAdapter.updateItems(messageList); | ... | ... |