public CryptedChatInviteReceivedEventArgs(ChatRoom room, ChatUser fromUser, int token, Action acceptInviteCallback)
 {
     Chat = room;
     FromUser = fromUser;
     Token = token;
     AcceptInviteCallback = acceptInviteCallback;
 }
 public CryptedChatUserWantsToJoinEventArgs(ChatRoom room, ChatUser user, Action acceptJoinCallback)
 {
     Chat = room;
     User = user;
     AcceptJoinCallback = acceptJoinCallback;
 }
Ejemplo n.º 3
0
 public ChatRoomStatusUpdateEventArgs(ChatRoom chatRoom)
 {
     ChatRoom = chatRoom;
 }
Ejemplo n.º 4
0
 public EncryptedChatSession(Session session, ChatRoom chatRoom)
 {
     _session = session;
     _chatRoom = chatRoom;
     _chatRoom.PacketReceived += ChatRoomOnPacketReceived;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Call this periodically to allow internal updating (once in a second or so)
        /// </summary>
        public void Update()
        {
            var currentSkypeChats = new List<Chat>();

            // check for chats joined
            foreach (var chatImpl in _bridge.SkypeInstance.ActiveChats)
            {
                if (_chats.Count(x => x.Name == (chatImpl as Chat).Name) == 0)
                {
                    var chat = new ChatRoom(this, chatImpl as Chat);
                    _chats.Add(chat);

                    if (ChatRoomJoined != null)
                    {
                        ChatRoomJoined(this, new ChatRoomStatusUpdateEventArgs(chat));
                    }
                }
                currentSkypeChats.Add(chatImpl as Chat);
            }

            // check for chats left
            var chatsToRemove = new List<ChatRoom>();
            foreach (var chatRoom in _chats)
            {
                if (currentSkypeChats.Count(x => x.Name == chatRoom.Name) == 0)
                {
                    if (ChatRoomLeft != null)
                    {
                        ChatRoomLeft(this, new ChatRoomStatusUpdateEventArgs(chatRoom));
                    }
                    chatsToRemove.Add(chatRoom);
                }
            }

            foreach (var chatToRemove in chatsToRemove)
            {
                _chats.Remove(chatToRemove);
            }

            // update all the chats (timer update)
            foreach (var chatRoom in _chats)
            {
                chatRoom.Update();
            }
        }