/// <summary> /// 离开群组 /// </summary> /// <param name="group"></param> /// <param name="reason"></param> private void onLeaveGroup(EMGroup group, EMGroupLeaveReason reason) { DBHelper.Instance.DeleteGroup(group.groupId()); client.getChatManager().removeConversation(group.groupId(), true); MainFrm main = (MainFrm)Application.OpenForms["MainFrm"]; if (main == null) { return; } main.removeConversation(group.groupId()); }
/// <summary> /// 废弃 /// </summary> /// <param name="group"></param> /// <param name="member"></param> private void onMemberJoinedGroup(EMGroup group, string member) { MainFrm main = (MainFrm)Application.OpenForms["MainFrm"]; if (main == null) { return; } main.refreshGroupInfo(group.groupId()); }
/// <summary> /// 废弃 /// </summary> /// <param name="group"></param> /// <param name="from"></param> /// <param name="message"></param> private void onReceiveJoinGroupApplication(EMGroup group, string from, string message) { MainFrm main = (MainFrm)Application.OpenForms["MainFrm"]; if (main == null) { return; } main.refreshGroupInfo(group.groupId()); }
/// <summary> /// 加入群组 /// </summary> /// <param name="group"></param> /// <param name="inviter"></param> /// <param name="inviteMessage"></param> private void onAutoAcceptInvitationFromGroup(EMGroup group, string inviter, string inviteMessage) { EMConversation conversation = EaseHelper.shard.client.getChatManager().conversationWithType(group.groupId(), EMConversationType.GROUPCHAT, true); EMTextMessageBody body = new EMTextMessageBody("你加入了群聊"); EMMessage message = EMMessage.createSendMessage(SettingMenager.shard.userID, group.groupId(), body, EMChatType.GROUP); conversation.insertMessage(message); MainFrm main = (MainFrm)Application.OpenForms["MainFrm"]; if (main == null) { return; } main.refreshGroupInfo(group.groupId()); }