public NewJitsiAppointment()
        {
            // Get the Application object
            Outlook.Application application = Globals.ThisAddIn.Application;

            try
            {
                // Generate meeting ID
                string jitsiRoomId = getRoomId();

                // Create meeting object
                newAppointment = (Outlook.AppointmentItem)application.CreateItem(Outlook.OlItemType.olAppointmentItem);


                // Appointment details
                newAppointment.Location = "Jitsi Meet";
                newAppointment.Body     = "Join the meeting: " + (JitsiUrl.getUrlBase() + jitsiRoomId);

                // Display ribbon group, then the appointment window
                Globals.ThisAddIn.ShowRibbonAppointment = true;
                newAppointment.Display(false);
                Globals.ThisAddIn.ShowRibbonAppointment = false;

                // Set ribbon control defaults
                findThisRibbon(); // This only works after message is displayed to user
                setRequireDisplayName();
                setStartWithAudioMuted();
                setStartWithVideoMuted();
                setRoomIdText(jitsiRoomId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("The following error occurred: " + ex.Message);
            }
        }
        public NewJitsiAppointment()
        {
            // Get the Application object
            Outlook.Application application = Globals.ThisAddIn.Application;

            try
            {
                // Generate meeting ID
                string jitsiRoomId = JitsiUrl.generateRoomId();

                // Create meeting object
                newAppointment = (Outlook.AppointmentItem)application.CreateItem(Outlook.OlItemType.olAppointmentItem);


                // Appointment details
                newAppointment.Location = "Jitsi Meet";
                newAppointment.Body     = "Join the meeting: " + (JitsiUrl.getUrlBase() + jitsiRoomId);

                // Display ribbon group, then the appointment window
                Globals.ThisAddIn.ShowRibbonAppointment = true;
                newAppointment.Display(false);
                Globals.ThisAddIn.ShowRibbonAppointment = false;

                // Set Room ID field
                setRoomIdText(jitsiRoomId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("The following error occurred: " + ex.Message);
            }
        }
示例#3
0
        private string getRoomId()
        {
            string roomId;

            if (Properties.Settings.Default.roomID.Length == 0)
            {
                roomId = JitsiUrl.generateRandomId();
            }
            else
            {
                roomId = Properties.Settings.Default.roomID;
            }

            return(roomId);
        }
示例#4
0
        public void setRoomId(string newRoomId)
        {
            string newDomain = JitsiUrl.getDomain();
            string oldBody   = appointmentItem.Body;


            // Replace old domain for new domain
            string newBody = oldBody.Replace(findRoomId(), newRoomId);

            newBody = newBody.Replace(oldDomain, newDomain);

            fieldRoomID.Text     = newRoomId;
            appointmentItem.Body = newBody;

            oldDomain = newDomain;
        }
        public void setRoomId(string newRoomId)
        {
            string newDomain = JitsiUrl.getDomain();
            string oldBody   = appointmentItem.Body;

            // Filter room id for legal characters
            string newRoomIdLegal = JitsiUrl.filterLegalCharacters(newRoomId);

            // Replace old domain for new domain
            string newBody = oldBody.Replace(findRoomId(), newRoomIdLegal);

            newBody = newBody.Replace(oldDomain, newDomain);

            fieldRoomID.Text     = newRoomIdLegal;
            appointmentItem.Body = newBody;

            oldDomain = newDomain;
        }
        public void setRoomId(string newRoomId)
        {
            string newDomain = JitsiUrl.getDomain();
            string oldBody   = appointmentItem.Body;

            // Filter room id for legal characters
            string newRoomIdLegal = JitsiUrl.filterLegalCharacters(newRoomId);

            string newBody;

            try
            {
                // Replace old domain for new domain
                newBody = oldBody.Replace(findRoomId(), newRoomIdLegal);
                newBody = newBody.Replace(oldDomain, newDomain);
            }
            catch
            {
                // If replacement failed, append new message text
                if (string.IsNullOrWhiteSpace(oldBody))
                {
                    newBody = NewJitsiAppointment.generateBody(newRoomIdLegal);
                }
                else
                {
                    newBody = oldBody + "\n" + NewJitsiAppointment.generateBody(newRoomIdLegal);
                }

                this.buttonStartWithAudioMuted.Checked = false;
                this.buttonStartWithVideoMuted.Checked = false;
                this.buttonRequireDisplayName.Checked  = false;
            }


            fieldRoomID.Text     = newRoomIdLegal;
            appointmentItem.Body = newBody;

            oldDomain = newDomain;
        }
示例#7
0
 public void randomiseRoomId()
 {
     setRoomId(JitsiUrl.generateRoomId());
 }
示例#8
0
 public static string generateBody(string roomId)
 {
     return(Globals.ThisAddIn.getElementTranslation("appointmentItem", "textBodyMessage") + (JitsiUrl.getUrlBase() + roomId));
 }