diff --git a/client/src/main/java/cn/wildfirechat/message/ConferenceInviteMessageContent.java b/client/src/main/java/cn/wildfirechat/message/ConferenceInviteMessageContent.java index 6bbc0e974..7508cf4f1 100644 --- a/client/src/main/java/cn/wildfirechat/message/ConferenceInviteMessageContent.java +++ b/client/src/main/java/cn/wildfirechat/message/ConferenceInviteMessageContent.java @@ -29,14 +29,18 @@ public class ConferenceInviteMessageContent extends MessageContent { private long startTime; private boolean audioOnly; private boolean audience; + // 会议PIN码,加入会议时使用 private String pin; + // 会议密码,查询会议时使用 + private String password; private boolean advanced; + private String callExtra; public ConferenceInviteMessageContent() { } - public ConferenceInviteMessageContent(String callId, String host, String title, String desc, long startTime, boolean audioOnly, boolean audience, boolean advanced, String pin) { + public ConferenceInviteMessageContent(String callId, String host, String title, String desc, long startTime, boolean audioOnly, boolean audience, boolean advanced, String pin, String password) { this.callId = callId; this.host = host; this.title = title; @@ -46,6 +50,7 @@ public ConferenceInviteMessageContent(String callId, String host, String title, this.audience = audience; this.advanced = advanced; this.pin = pin; + this.password = password; } public String getCallId() { @@ -121,6 +126,22 @@ public void setAdvanced(boolean advanced) { this.advanced = advanced; } + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getCallExtra() { + return callExtra; + } + + public void setCallExtra(String callExtra) { + this.callExtra = callExtra; + } + @Override public MessagePayload encode() { MessagePayload payload = super.encode(); @@ -145,9 +166,15 @@ public MessagePayload encode() { if (desc != null) { objWrite.put("d", desc); } + if (password != null) { + objWrite.put("pwd", password); + } + if (callExtra != null) { + objWrite.put("ce", callExtra); + } - objWrite.put("audience", audience?1:0); - objWrite.put("advanced", advanced?1:0); + objWrite.put("audience", audience ? 1 : 0); + objWrite.put("advanced", advanced ? 1 : 0); objWrite.put("a", audioOnly ? 1 : 0); objWrite.put("p", pin); @@ -174,9 +201,11 @@ public void decode(MessagePayload payload) { title = jsonObject.optString("t"); desc = jsonObject.optString("d"); pin = jsonObject.optString("p"); + password = jsonObject.optString("pwd"); + callExtra = jsonObject.optString("ce"); startTime = jsonObject.optLong("s"); - audience = jsonObject.optInt("audience")>0; - advanced = jsonObject.optInt("advanced")>0; + audience = jsonObject.optInt("audience") > 0; + advanced = jsonObject.optInt("advanced") > 0; audioOnly = jsonObject.optInt("a") > 0; } } catch (JSONException e) { @@ -199,14 +228,16 @@ public int describeContents() { public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeString(callId); - dest.writeString(host!=null ? host:""); - dest.writeString(title!=null?title:""); - dest.writeString(desc!=null?desc:""); + dest.writeString(host != null ? host : ""); + dest.writeString(title != null ? title : ""); + dest.writeString(desc != null ? desc : ""); dest.writeLong(startTime); dest.writeByte(audioOnly ? (byte) 1 : (byte) 0); dest.writeByte(audience ? (byte) 1 : (byte) 0); dest.writeByte(advanced ? (byte) 1 : (byte) 0); - dest.writeString(pin!=null?pin:""); + dest.writeString(pin != null ? pin : ""); + dest.writeString(password != null ? password : ""); + dest.writeString(callExtra != null ? callExtra : ""); } protected ConferenceInviteMessageContent(Parcel in) { @@ -221,6 +252,8 @@ protected ConferenceInviteMessageContent(Parcel in) { audience = in.readByte() != 0; advanced = in.readByte() != 0; pin = in.readString(); + password = in.readString(); + callExtra = in.readString(); } public static final Creator CREATOR = new Creator() { diff --git a/uikit/src/main/java/cn/wildfire/chat/kit/conversation/message/viewholder/ConferenceInviteMessageContentViewHolder.java b/uikit/src/main/java/cn/wildfire/chat/kit/conversation/message/viewholder/ConferenceInviteMessageContentViewHolder.java index 3cfe9c66c..672068dc0 100644 --- a/uikit/src/main/java/cn/wildfire/chat/kit/conversation/message/viewholder/ConferenceInviteMessageContentViewHolder.java +++ b/uikit/src/main/java/cn/wildfire/chat/kit/conversation/message/viewholder/ConferenceInviteMessageContentViewHolder.java @@ -84,7 +84,7 @@ void joinConference() { // AVEngineKit.Instance().joinConference(inviteMessageContent.getCallId(), inviteMessageContent.isAudioOnly(), inviteMessageContent.getPin(), inviteMessageContent.getHost(), inviteMessageContent.getTitle(), inviteMessageContent.getDesc(), inviteMessageContent.isAudience(), inviteMessageContent.isAdvanced(), false, false, null); Intent intent = new Intent(fragment.getActivity(), ConferenceInfoActivity.class); intent.putExtra("conferenceId", inviteMessageContent.getCallId()); - intent.putExtra("password", inviteMessageContent.getPin()); + intent.putExtra("password", inviteMessageContent.getPassword()); fragment.startActivity(intent); } } diff --git a/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceActivity.java b/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceActivity.java index 3b199a570..195cea2e5 100644 --- a/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceActivity.java +++ b/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceActivity.java @@ -336,7 +336,8 @@ void showParticipantList() { public void inviteNewParticipant() { preventShowFloatingViewOnStop = true; AVEngineKit.CallSession session = AVEngineKit.Instance().getCurrentSession(); - ConferenceInviteMessageContent invite = new ConferenceInviteMessageContent(session.getCallId(), ConferenceManager.getManager().getCurrentConferenceInfo().getOwner(), session.getTitle(), session.getDesc(), session.getStartTime(), session.isAudioOnly(), session.isDefaultAudience(), session.isAdvanced(), session.getPin()); + ConferenceInfo conferenceInfo = ConferenceManager.getManager().getCurrentConferenceInfo(); + ConferenceInviteMessageContent invite = new ConferenceInviteMessageContent(session.getCallId(), ConferenceManager.getManager().getCurrentConferenceInfo().getOwner(), session.getTitle(), session.getDesc(), session.getStartTime(), session.isAudioOnly(), session.isDefaultAudience(), session.isAdvanced(), session.getPin(), conferenceInfo.getPassword()); Intent intent = new Intent(this, ConferenceInviteActivity.class); intent.putExtra("inviteMessage", invite); startActivityForResult(intent, REQUEST_CODE_ADD_PARTICIPANT); diff --git a/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceParticipantListActivity.java b/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceParticipantListActivity.java index 4b6989498..444c4b8e7 100644 --- a/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceParticipantListActivity.java +++ b/uikit/src/main/java/cn/wildfire/chat/kit/voip/conference/ConferenceParticipantListActivity.java @@ -44,7 +44,7 @@ private void addParticipant() { AVEngineKit.CallSession session = AVEngineKit.Instance().getCurrentSession(); ConferenceManager conferenceManager = ConferenceManager.getManager(); ConferenceInfo conferenceInfo = conferenceManager.getCurrentConferenceInfo(); - ConferenceInviteMessageContent invite = new ConferenceInviteMessageContent(session.getCallId(), conferenceInfo.getOwner(), session.getTitle(), session.getDesc(), session.getStartTime(), session.isAudioOnly(), session.isDefaultAudience(), session.isAdvanced(), session.getPin()); + ConferenceInviteMessageContent invite = new ConferenceInviteMessageContent(session.getCallId(), conferenceInfo.getOwner(), session.getTitle(), session.getDesc(), session.getStartTime(), session.isAudioOnly(), session.isDefaultAudience(), session.isAdvanced(), session.getPin(), conferenceInfo.getPassword()); Intent intent = new Intent(this, ConferenceInviteActivity.class); intent.putExtra("inviteMessage", invite);