Esempio n. 1
0
        internal void RemoveChat(BitChat chat)
        {
            //announce no participation in chat
            byte[] packetData = BitChatMessage.CreateFileUnparticipate(_metaData.FileID);
            chat.WriteMessageBroadcast(packetData, 0, packetData.Length);

            //remove chat from list
            lock (_chats)
            {
                _chats.Remove(chat);

                if (_chats.Count == 0)
                {
                    lock (_sharedFiles)
                    {
                        _sharedFiles.Remove(_metaData.FileID);
                    }

                    this.Dispose();
                }
            }
        }