Skip to content

Commit

Permalink
会议邀请消息和 iOS 同步 fix #895
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Jan 14, 2025
1 parent 1573878 commit 846cbfc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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<ConferenceInviteMessageContent> CREATOR = new Creator<ConferenceInviteMessageContent>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 846cbfc

Please sign in to comment.