From d65b71b584283e50c14cd1967c8954166733e342 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= <saghul@jitsi.org>
Date: Wed, 29 May 2019 13:28:42 +0200
Subject: [PATCH] rn: add ability to set the conference subject

---
 .../meet/sdk/JitsiMeetConferenceOptions.java  | 22 +++++++++++++++++++
 ios/sdk/src/JitsiMeetConferenceOptions.h      |  6 +++++
 ios/sdk/src/JitsiMeetConferenceOptions.m      |  5 +++++
 3 files changed, 33 insertions(+)

diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
index 99c8ab015..69e0dbb03 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java
@@ -40,6 +40,10 @@ public class JitsiMeetConferenceOptions implements Parcelable {
      * Room name.
      */
     private String room;
+    /**
+     * Conference subject.
+     */
+    private String subject;
     /**
      * JWT token used for authentication.
      */
@@ -70,6 +74,7 @@ public class JitsiMeetConferenceOptions implements Parcelable {
     public static class Builder {
         private URL serverURL;
         private String room;
+        private String subject;
         private String token;
 
         private Bundle colorScheme;
@@ -105,6 +110,17 @@ public class JitsiMeetConferenceOptions implements Parcelable {
             return this;
         }
 
+        /**
+         * Sets the conference subject.
+         * @param subject - Subject for the conference.
+         * @return - The {@link Builder} object itself so the method calls can be chained.
+         */
+        public Builder setSubject(String subject) {
+            this.subject = subject;
+
+            return this;
+        }
+
         /**
          * Sets the JWT token to be used for authentication when joining a conference.
          * @param token - The JWT token to be used for authentication.
@@ -185,6 +201,7 @@ public class JitsiMeetConferenceOptions implements Parcelable {
 
             options.serverURL = this.serverURL;
             options.room = this.room;
+            options.subject = this.subject;
             options.token = this.token;
             options.colorScheme = this.colorScheme;
             options.audioMuted = this.audioMuted;
@@ -201,6 +218,7 @@ public class JitsiMeetConferenceOptions implements Parcelable {
 
     private JitsiMeetConferenceOptions(Parcel in) {
         room = in.readString();
+        subject = in.readString();
         token = in.readString();
         colorScheme = in.readBundle();
         byte tmpAudioMuted = in.readByte();
@@ -238,6 +256,9 @@ public class JitsiMeetConferenceOptions implements Parcelable {
         if (videoMuted != null) {
             config.putBoolean("startWithVideoMuted", videoMuted);
         }
+        if (subject != null) {
+            config.putString("subject", subject);
+        }
 
         Bundle urlProps = new Bundle();
 
@@ -281,6 +302,7 @@ public class JitsiMeetConferenceOptions implements Parcelable {
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString(room);
+        dest.writeString(subject);
         dest.writeString(token);
         dest.writeBundle(colorScheme);
         dest.writeByte((byte) (audioMuted == null ? 0 : audioMuted ? 1 : 2));
diff --git a/ios/sdk/src/JitsiMeetConferenceOptions.h b/ios/sdk/src/JitsiMeetConferenceOptions.h
index a25a76f63..5b4e26e51 100644
--- a/ios/sdk/src/JitsiMeetConferenceOptions.h
+++ b/ios/sdk/src/JitsiMeetConferenceOptions.h
@@ -26,6 +26,10 @@
  * Room name.
  */
 @property (nonatomic, copy, nullable) NSString *room;
+/**
+ * Conference subject.
+ */
+@property (nonatomic, copy, nullable) NSString *subject;
 /**
  * JWT token used for authentication.
  */
@@ -56,7 +60,9 @@
 @interface JitsiMeetConferenceOptions : NSObject
 
 @property (nonatomic, copy, nullable, readonly) NSURL *serverURL;
+
 @property (nonatomic, copy, nullable, readonly) NSString *room;
+@property (nonatomic, copy, nullable, readonly) NSString *subject;
 @property (nonatomic, copy, nullable, readonly) NSString *token;
 
 @property (nonatomic, copy, nullable) NSDictionary *colorScheme;
diff --git a/ios/sdk/src/JitsiMeetConferenceOptions.m b/ios/sdk/src/JitsiMeetConferenceOptions.m
index ba07f6891..a97e3f8fe 100644
--- a/ios/sdk/src/JitsiMeetConferenceOptions.m
+++ b/ios/sdk/src/JitsiMeetConferenceOptions.m
@@ -34,6 +34,7 @@
     if (self = [super init]) {
         _serverURL = nil;
         _room = nil;
+        _subject = nil;
         _token = nil;
 
         _colorScheme = nil;
@@ -138,6 +139,7 @@
     if (self = [super init]) {
         _serverURL = builder.serverURL;
         _room = builder.room;
+        _subject = builder.subject;
         _token = builder.token;
 
         _colorScheme = builder.colorScheme;
@@ -183,6 +185,9 @@
     if (_videoMuted != nil) {
         config[@"startWithVideoMuted"] = @(self.videoMuted);
     }
+    if (_subject != nil) {
+        config[@"subject"] = self.subject;
+    }
 
     NSMutableDictionary *urlProps = [[NSMutableDictionary alloc] init];