Ejemplo n.º 1
0
        public void CreateOTRSession(string my_buddy_unique_id, bool debug_mode)
        {
            if (string.IsNullOrEmpty(my_buddy_unique_id))
            {
                throw new ArgumentException("CreateOTRSession:My buddy uique ID cannot be null/empty");
            }


            if (IsSessionRegistered(my_buddy_unique_id) == true)
            {
                throw new ArgumentException("CreateOTRSession: A session with this unique ID already exists");
            }

            OTRSession _session_object = new OTRSession(_my_unique_id, my_buddy_unique_id, debug_mode);

            _session_object.OnOTREvent += new OTREventHandler(OTRSessionEventHandler);

            _otr_session_register.Add(my_buddy_unique_id, _session_object);
        }
Ejemplo n.º 2
0
        public void CreateOTRSession(string my_buddy_unique_id, DSAKeyParams dsa_key_hex_string)
        {
            if (string.IsNullOrEmpty(my_buddy_unique_id))
            {
                throw new ArgumentException("CreateOTRSession:My buddy uique ID cannot be null/empty");
            }

            if (dsa_key_hex_string == null)
            {
                throw new ArgumentException("CreateOTRSession:The DSA key parameter object cannot be null");
            }


            if (IsSessionRegistered(my_buddy_unique_id) == true)
            {
                throw new InvalidDataException("CreateOTRSession: A session with this unique ID already exists");
            }

            OTRSession _session_object = new OTRSession(_my_unique_id, my_buddy_unique_id, dsa_key_hex_string);

            _session_object.OnOTREvent += new OTREventHandler(OTRSessionEventHandler);

            _otr_session_register.Add(my_buddy_unique_id, _session_object);
        }