Beispiel #1
0
        /// <summary>
        /// Adds a group to the groupList if its not in already.
        /// Also creates a chatHistory for the group.
        /// </summary>
        /// <param name="group"></param>
        public void AddGroup(Group group) {
            if (_groupList == null)
                _groupList = new List<Group>();

            if(!_groupList.Any(groupObj => groupObj.GroupHash.Equals(group.GroupHash))) {
                _groupList.Add(group);
                AddChatHistory(group.GroupHash, true);
            }
        }
Beispiel #2
0
 public void SendGroupMessage(Group group, string message) {
     group.ClientList.ForEach(client => {
         string encryptedMessage = SecurityManager.EncryptText(message, client.PublicKey);
         _socket.Emit("message", JObject.FromObject(new JsonSendMessage() { ReceiverIdentifier = client.PublicKeyHash, GroupHash = group.GroupHash, Message = encryptedMessage }));
     });
 }