예제 #1
0
 public void Confirmation(string sender, string receiver, bool ok, bool isGroup)
 {
     if (isGroup)
     {
         GroupConversation group = Subscriber.GetGroup(receiver);
         if (ok)
         {
             group.UserJoinAudio(sender);
         }
     }
     else
     {
         UserInformation user = Subscriber.getUser(receiver);
         if (user != null && user.AudioCallback != null)
         {
             if (ok)
             {
                 user.AudioCallback.ChannelAccepted(sender);
             }
             else
             {
                 user.AudioCallback.ChannelDeclined(sender);
             }
         }
     }
 }
예제 #2
0
        public void RefuseGroupShareScreen(string sender, string groupName)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                group.UserRefusedShareSCreen(sender);
            }
        }
예제 #3
0
        public void SendGroupMessage(string sender, string groupName, string message)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                group.SendMessage(sender, message);
            }
        }
예제 #4
0
        public void SendVoiceGroup(byte[] voice, int byteRecorded, string groupName, string sender)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                group.SendVoiceAudio(sender, voice, byteRecorded);
            }
        }
예제 #5
0
        public void DeclineGroupRequest(string sender, string groupName)
        {
            UserInformation   user  = Subscriber.getUser(sender);
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                group.UserDeclined(sender);
            }
        }
예제 #6
0
        public List <string> GetGroupMembers(string groupName)
        {
            List <string>     list  = new List <string>();
            GroupConversation group = Subscriber.GetGroup(groupName);

            foreach (UserInformation user in group.Members)
            {
                list.Add(user.Username);
            }
            return(list);
        }
예제 #7
0
        public void InitShareScreenGroup(string sender, string groupName, string connectionString)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            foreach (UserInformation user in group.Members)
            {
                if (user.Username != sender)
                {
                    user.ScreenShareCallback.GroupShareScreenNotification(sender, group.GroupName, connectionString);
                }
            }
        }
예제 #8
0
        public void UserLeftShareScreen(string sender, string groupName)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            foreach (UserInformation user in group.Members)
            {
                if (user != null && user.Username != sender)
                {
                    user.ScreenShareCallback.UserLeftShareScreenGroup(sender, group.GroupName);
                }
            }
        }
예제 #9
0
        public bool CreateGroupConversation(string creator, string groupName)
        {
            if (Subscriber.GroupConversations.Exists(x => x.Creator == creator && x.GroupName == groupName))
            {
                return(false);
            }

            GroupConversation group = new GroupConversation(creator, groupName);

            Subscriber.GroupConversations.Add(group);
            return(true);
        }
예제 #10
0
        public void LeaveGroup(string sender, string groupName)
        {
            UserInformation   user  = Subscriber.getUser(sender);
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                group.UserLeft(sender);
                if (group.Members.Count == 0)
                {
                    Subscriber.GroupConversations.Remove(group);
                }
            }
        }
예제 #11
0
        public bool AcceptGroupRequest(string sender, string groupName)
        {
            UserInformation   user  = Subscriber.getUser(sender);
            GroupConversation group = Subscriber.GetGroup(groupName);

            if (group != null)
            {
                if (!group.UserExits(sender))
                {
                    group.UserJoined(sender);
                }
                return(true);
            }
            return(false);
        }
예제 #12
0
 public void StopCall(string sender, string receiver, bool isGroup)
 {
     if (isGroup)
     {
         GroupConversation group = Subscriber.GetGroup(receiver);
         group.UserLeftAudio(sender);
     }
     else
     {
         UserInformation user = Subscriber.getUser(receiver);
         if (user != null && user.AudioCallback != null)
         {
             user.AudioCallback.StopCall(sender);
         }
     }
 }
예제 #13
0
        public void InitCommunicationGroup(string sender, string groupName)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            group.InviteMembersToAudioCall(sender);
        }