Ejemplo n.º 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);
             }
         }
     }
 }
Ejemplo n.º 2
0
        public void RefuseGroupShareScreen(string sender, string groupName)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

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

            if (group != null)
            {
                group.SendMessage(sender, message);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 13
0
        public void InitCommunicationGroup(string sender, string groupName)
        {
            GroupConversation group = Subscriber.GetGroup(groupName);

            group.InviteMembersToAudioCall(sender);
        }