Example #1
0
 public void Open(Storage storage, JabberUser selectedJabberUser)
 {
     this.mStorage = storage;
     ResetHTML();
     loadArchiveUsersList(selectedJabberUser);
     tbxSearchText.Focus();
 }
Example #2
0
 public void Open(Storage storage, JabberUser selectedJabberUser)
 {
     this.mStorage = storage;
     wbConversation.DocumentText = "<HTML><BODY></BODY></HTML>";
     loadArchiveUsersList(selectedJabberUser.JID);
     tbxSearchText.Focus();
 }
Example #3
0
 public void Logout()
 {
     _username   = null;
     _password   = null;
     _authorized = false;
     _jabberUser = null;
     Contact     = null;
 }
Example #4
0
        public void loadArchiveSelectedUser(string selectedUser, string search)
        {
            if (this.InvokeRequired)
            {
                BeginInvoke(new loadArchiveSelectedUserDelegate(loadArchiveSelectedUser), new object[] { selectedUser, search });
                return;
            }
            wbConversation.Document.OpenNew(true);

            Emoticons myEmoticons = new Emoticons(Directory.GetCurrentDirectory() + "\\Emoticons\\");

            List<Remwave.Client.Storage.StorageMessage> list = mStorage.GetMessageFromArchive(selectedUser, search, 2048);
            ChatController.MessageTemplate tmplMessageTemplate = new MessageTemplate(MessageTemplateType.Notification);
            wbConversation.Document.Write(tmplMessageTemplate.Message);
            for (int i = list.Count - 1; i >= 0; i--)
            {
                JabberUser jabberUser = null;

                MessageStyle incomingStyle = new MessageStyle(Color.White, new System.Drawing.Font("Trebuchet MS", 8.5F, System.Drawing.FontStyle.Regular), Color.Black, Color.Red);
                MessageStyle outgoingStyle = new MessageStyle(Color.White, new System.Drawing.Font("Trebuchet MS", 8.5F, System.Drawing.FontStyle.Regular), Color.Black, Color.Blue);
                MessageTemplateType template = MessageTemplateType.Notification;
                MessageStyle style = new MessageStyle(Color.White, new System.Drawing.Font("Trebuchet MS", 8.5F, System.Drawing.FontStyle.Regular), Color.Gray, Color.Gray);

                String messageHTML = "";


                if (list[i].ContentHTML != "")
                {

                    messageHTML = list[i].ContentHTML;
                }
                else
                {
                    messageHTML = list[i].ContentText;
                }





                //Compatibility with legacy text only messages
                if (list[i].Direction == StorageItemDirection.In)
                {
                    style = incomingStyle;
                    template = MessageTemplateType.In;
                    jabberUser = new JabberUser(list[i].JID);
                }
                else
                {
                    style = outgoingStyle;
                    template = MessageTemplateType.Out;
                    jabberUser = new JabberUser(mStorage.Username);
                }
                IMMessage message = new IMMessage(jabberUser.Nick, messageHTML, list[i].GUID, list[i].Created, style, template, myEmoticons);
                wbConversation.Document.Write(message.HTML);
            }
        }
Example #5
0
 public void Credentials(string username, string password)
 {
     this.Logout();
     _username          = username;
     _password          = password;
     _jabberUser        = new JabberUser(username + @"@" + ConfigIM.IMServer);
     Contact            = new NTContact();
     Contact.NTJabberID = _jabberUser.JID;
 }
Example #6
0
        private String GetContactName(NTContact contact)
        {
            //prepare contact name and username from NTContact
            String name = "";
            String nick = "";
            if (contact != null)
            {

                name = contact.FullName().Trim().Length > 64 ? contact.FullName().Trim().Substring(0, 64) : contact.FullName().Trim();
                nick = new JabberUser(contact.NTJabberID).Nick;
            }
            return name + " (" + nick + ")";
        }
Example #7
0
 private IQMessage IQMessage_Roster(JabberUser jabberUser, String group)
 {
     String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" type=\"set\"><query xmlns=\"jabber:iq:roster\"><item jid=\"" + jabberUser.EscapedJID + "\" name=\"" + jabberUser.Nick + "\" subscription=\"to\"><group>" + group + "</group></item></query></iq>";
     return new IQMessage(jabberUser.Domain, message);
 }
Example #8
0
 private IQMessage IQMessage_Subscribe(JabberUser jabberUser)
 {
     String message = "<presence id=\"" + mTag + "-" + mCounter.ToString() + "\" to=\"" + jabberUser.EscapedJID + "\"  type=\"subscribe\"/>";
     return new IQMessage(jabberUser.Domain, message);
 }
Example #9
0
        public ContactsWindow(ClientForm clientForm, NTContact selectedMyContact, Hashtable properties)
        {
            InitializeComponent();
            LocalizeComponent();
            this.ClientSize = this.Size;
            this.MaximizeBox = false;
            this.MaximumSize = this.Size;

            myClientForm = clientForm;
            mContactBook = myClientForm.mContactBook;
            if (selectedMyContact != null)
            {
                myNTContact = selectedMyContact;
            }
            else
            {
                myNTContact = new NTContact();
            }

            myContactJabberGroupListBox.Items.Clear();
            myContactJabberIMNetworkListBox.DataSource = Enum.GetValues(typeof(ConfigXMPPNetwork));
            myContactJabberIMNetworkListBox.SelectedIndex = 0;

            comboBox1.DataSource = Enum.GetValues(typeof(NTContactStore));

            myContactJabberIDInput.Text = myNTContact.NTJabberID;
			
			
			myContactJabberGroupListBox.Items.Clear();
            myContactJabberGroupListBox.Items.Add("");         
            myContactFirstNameInput.Text = myNTContact.NTFirstName;
            myContactMiddleNameInput.Text = myNTContact.NTMiddleName;
            myContactLastNameInput.Text = myNTContact.NTLastName;
            myContactPhoneHomeInput.Text = myNTContact.NTHomeTelephoneNumber;
            myContactPhoneMobileInput.Text = myNTContact.NTMobileTelephoneNumber;
            myContactPhoneBusinessInput.Text = myNTContact.NTBusinessTelephoneNumber;
            myContactPhoneVoIPInput.Text = myNTContact.NTVoIPTelephoneNumber;

            myContactJabberIDInput.Text = myNTContact.NTJabberID;

            myContactAddressStreetInput.Text = myNTContact.NTHomeAddressStreet;
            myContactAddressCityInput.Text = myNTContact.NTHomeAddressCity;
            myContactAddressZipCodeInput.Text = myNTContact.NTHomeAddressPostalCode;
            myContactAddressStateInput.Text = myNTContact.NTHomeAddressState;
            myContactAddressCountryInput.Text = myNTContact.NTHomeAddressCountry;

            myContactAddressEmailInput.Text = myNTContact.NTEmail1Address;

            try
            {
                myContactPicture.Image = ImageProcessing.FromString(myNTContact.NTPicture);
            }
            catch (Exception)
            {
                
            }
                

            if (properties != null)
            {
                myContactFirstNameInput.Text = properties["NTFirstName"] != null ? properties["NTFirstName"].ToString() : myNTContact.NTFirstName;
                myContactMiddleNameInput.Text = properties["NTMiddleName"] != null ? properties["NTMiddleName"].ToString() : myNTContact.NTMiddleName;
                myContactLastNameInput.Text = properties["NTLastName"] != null ? properties["NTLastName"].ToString() : myNTContact.NTLastName;
                myContactPhoneHomeInput.Text = properties["NTHomeTelephoneNumber"] != null ? properties["NTHomeTelephoneNumber"].ToString() : myNTContact.NTHomeTelephoneNumber;
                myContactPhoneMobileInput.Text = properties["NTMobileTelephoneNumber"] != null ? properties["NTMobileTelephoneNumber"].ToString() : myNTContact.NTMobileTelephoneNumber;
                myContactPhoneBusinessInput.Text = properties["NTBusinessTelephoneNumber"] != null ? properties["NTBusinessTelephoneNumber"].ToString() : myNTContact.NTBusinessTelephoneNumber;
                myContactPhoneVoIPInput.Text = properties["NTVoIPTelephoneNumber"] != null ? properties["NTVoIPTelephoneNumber"].ToString() : myNTContact.NTVoIPTelephoneNumber;
                myContactJabberIDInput.Text = properties["NTJabberID"] != null ? properties["NTJabberID"].ToString() : myNTContact.NTJabberID;

                myContactAddressStreetInput.Text = properties["NTHomeAddressStreet"] != null ? properties["NTHomeAddressStreet"].ToString() : myNTContact.NTHomeAddressStreet;
                myContactAddressCityInput.Text = properties["NTHomeAddressCity"] != null ? properties["NTHomeAddressCity"].ToString() : myNTContact.NTHomeAddressCity;
                myContactAddressZipCodeInput.Text = properties["NTHomeAddressPostalCode"] != null ? properties["NTHomeAddressPostalCode"].ToString() : myNTContact.NTHomeAddressPostalCode;
                myContactAddressStateInput.Text = properties["NTHomeAddressState"] != null ? properties["NTHomeAddressState"].ToString() : myNTContact.NTHomeAddressState;
                myContactAddressCountryInput.Text = properties["NTHomeAddressCountry"] != null ? properties["NTHomeAddressCountry"].ToString() : myNTContact.NTHomeAddressCountry;

                myContactAddressEmailInput.Text = properties["NTEmail1Address"] != null ? properties["NTEmail1Address"].ToString() : myNTContact.NTEmail1Address;
            }

            JabberUser jabberUser = null;
            if (myContactJabberIDInput.Text != "")
            {
                jabberUser = new JabberUser(myContactJabberIDInput.Text);
                myContactJabberIDInput.Text = jabberUser.Username;
                myContactJabberIMNetworkListBox.SelectedItem = jabberUser.Network;
            }

            comboBox1.SelectedItem = myNTContact.NTContactStore;

            foreach (DictionaryEntry group in myClientForm.myBuddyGroups)
            {


                if (group.Value.ToString() != "" && !myContactJabberGroupListBox.Items.Contains(group.Value.ToString()))
                    myContactJabberGroupListBox.Items.Add(group.Value.ToString());



                if (jabberUser != null && jabberUser.Username == group.Key.ToString())
                {
                    myContactJabberGroupListBox.SelectedIndex = myContactJabberGroupListBox.Items.Count - 1;
                }
            }



            if (myClientForm.mUserAccount.Username == myContactJabberIDInput.Text)
            {
                myContactJabberGroupBox.Visible = false;
            }
            


        }
Example #10
0
 private IQMessage IQMessage_Prompt(JabberUser jabberUser)
 {
     String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" to=\"" + jabberUser.Domain + "\" type=\"set\"><query xmlns=\"jabber:iq:gateway\"><prompt>" + jabberUser.Username + "</prompt></query></iq>";
     return new IQMessage(jabberUser.Domain, message);
 }
Example #11
0
 internal void Subscibe(JabberUser jabberUser)
 {
     this.OnSendIQMessage(IQMessage_Subscribe(jabberUser), new EventArgs());
 }
Example #12
0
 public Activity(ActivityType activityType, JabberUser activityJabberUser, String activityOtherData)
 {
     ActivityType       = activityType;
     ActivityOtherData  = activityOtherData;
     ActivityJabberUser = activityJabberUser;
 }
Example #13
0
 internal void Roster(JabberUser jabberUser, String group)
 {
     this.OnSendIQMessage(IQMessage_Roster(jabberUser, group), new EventArgs());
 }
Example #14
0
 internal void RequestVCard(JabberUser jabberUser, Boolean remote)
 {
     this.OnSendIQMessage(IQMessage_RequestVCard(jabberUser, remote), new EventArgs());
 }
Example #15
0
 private IQMessage IQMessage_RetriveAvatar(JabberUser jabberUser)
 {
     String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" type='get' to=\"" + jabberUser.EscapedJID + "\"><query xmlns='storage:client:avatar'/></iq>";
     return new IQMessage(jabberUser.Domain, message);
 }
Example #16
0
        private IQMessage IQMessage_StoreVCard(JabberUser jabberUser, NTContact contact)
        {
            String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" from=\"" + jabberUser.EscapedJID + "\" type=\"set\"> <vCard xmlns=\"vcard-temp\"> <N> <FAMILY>{NTLastName}</FAMILY> <GIVEN>{NTFirstName}</GIVEN> <MIDDLE>{NTMiddleName}</MIDDLE> </N> <ORG> <ORGNAME/> <ORGUNIT/> </ORG> <FN>{NTFirstName} {NTMiddleName} {NTLastName}</FN> <URL/> <TITLE/> <NICKNAME>{NTNickname}</NICKNAME> <PHOTO> <TYPE>image/jpeg</TYPE> <BINVAL>{NTPicture}</BINVAL> </PHOTO> <EMAIL> <HOME/> <INTERNET/> <PREF/> <USERID>{NTEmail1Address}</USERID> </EMAIL> <TEL> <PAGER/> <WORK/> <NUMBER/> </TEL> <TEL> <CELL/> <WORK/> <NUMBER/> </TEL> <TEL> <VOICE/> <WORK/> <NUMBER>{NTBusinessTelephoneNumber}</NUMBER> </TEL> <TEL> <FAX/> <WORK/> <NUMBER/> </TEL> <TEL> <PAGER/> <HOME/> <NUMBER/> </TEL> <TEL> <CELL/> <HOME/> <NUMBER>{NTMobileTelephoneNumber}</NUMBER> </TEL> <TEL> <VOICE/> <HOME/> <NUMBER>{NTHomeTelephoneNumber}</NUMBER> </TEL> <TEL> <FAX/> <HOME/> <NUMBER/> </TEL> <ADR> <WORK/> <PCODE/> <REGION/> <STREET/> <CTRY/> <LOCALITY/> </ADR> <ADR> <HOME/> <PCODE>{NTHomeAddressPostalCode}</PCODE> <REGION>{NTHomeAddressState}</REGION> <STREET>{NTHomeAddressStreet}</STREET> <CTRY>{NTHomeAddressCountry}</CTRY> <LOCALITY>{NTHomeAddressCity}</LOCALITY> </ADR> </vCard> </iq> ";

            if (contact.NTPicture.Length > 0) mPresenceAvatarSHA1 = SHA1_ComputeHexaHash(System.Convert.FromBase64String(contact.NTPicture));

            message = message
                .Replace("{NTFirstName}", contact.NTFirstName)
                .Replace("{NTMiddleName}", contact.NTMiddleName)
                .Replace("{NTLastName}", contact.NTLastName)
                .Replace("{NTNickname}", contact.NTNickname)
                .Replace("{NTEmail1Address}", contact.NTEmail1Address)
                .Replace("{NTBusinessTelephoneNumber}", contact.NTBusinessTelephoneNumber)
                .Replace("{NTHomeTelephoneNumber}", contact.NTHomeTelephoneNumber)
                .Replace("{NTMobileTelephoneNumber}", contact.NTMobileTelephoneNumber)
                .Replace("{NTHomeAddressStreet}", contact.NTHomeAddressStreet)
                .Replace("{NTHomeAddressCity}", contact.NTHomeAddressCity)
                .Replace("{NTHomeAddressPostalCode}", contact.NTHomeAddressPostalCode)
                .Replace("{NTHomeAddressState}", contact.NTHomeAddressState)
                .Replace("{NTHomeAddressCountry}", contact.NTHomeAddressCountry)
                .Replace("{NTPicture}", contact.NTPicture);

            return new IQMessage(jabberUser.Domain, message);
        }
Example #17
0
 private IQMessage IQMessage_Remove(JabberUser jabberUser)
 {
     String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" type=\"set\"><query xmlns=\"jabber:iq:roster\"><item jid=\"" + jabberUser.EscapedJID + "\" subscription=\"remove\"/></query></iq>";
     return new IQMessage(jabberUser.Domain, message);
 }
Example #18
0
        private void DisplaySelectionOptions(NTContact contact)
        {
            int itemsHeight = 0;
            displayingContacts = false;
            //build sub menue

            Font listItemNameFont = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ;
            Font listItemDescriptionFont = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            Font listSubItemNameFont = new System.Drawing.Font("Trebuchet MS", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); ;
            Font listSubItemDescriptionFont = new System.Drawing.Font("Trebuchet MS", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            Size listItemSize = new Size(300, 44);
            Size listSubItemSize = new Size(300, 44);

            lbxSearchResults.Items.Clear();

            lbxSearchResults.Items.Add(BuildRadMenuContentItem(
            contact,
            GetContactName(contact),
            GetContactPrimaryPhoneNumbers(contact),
            ((System.Drawing.Image)(Properties.Resources.listIconVcard)),
            listItemSize,
            listItemNameFont,
            listItemDescriptionFont,
            Telerik.WinControls.ElementVisibility.Visible,
            false
            ));

            itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            if (contact.NTJabberID != "")
            {
                JabberUser contactJabberUser = new JabberUser(contact.NTJabberID, contact.NTNickname);

                //Call PC2PC
                Activity activityPC2PCCall = new Activity(ActivityType.Call, contactJabberUser, null);

                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityPC2PCCall,
                Properties.Localization.txtCMenuCallComputer,
                contactJabberUser.Nick,
                ((System.Drawing.Image)(Properties.Resources.listIconComputer)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

                //Send Instant Message
                Activity activityIM = new Activity(ActivityType.IM, contactJabberUser, null);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityIM,
                Properties.Localization.txtCMenuSendMessage,
                contactJabberUser.Nick,
                ((System.Drawing.Image)(Properties.Resources.listIconInstantMessage)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

                //Start Video Call
                Activity activityVideoCall = new Activity(ActivityType.VideoCall, contactJabberUser, null);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityVideoCall,
                Properties.Localization.txtCMenuVideoCall,
                contactJabberUser.Nick,
                ((System.Drawing.Image)(Properties.Resources.listIconWebcam)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

                //Start Screen Sharing
                Activity activityScreenSharing = new Activity(ActivityType.ScreenSharing, contactJabberUser, null);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityScreenSharing,
                Properties.Localization.txtCMenuScreenSharing,
                contactJabberUser.Nick,
                ((System.Drawing.Image)(Properties.Resources.listIconScreenSharing)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            }

            if (contact.NTHomeTelephoneNumber != "")
            {
                //Call Home
                Activity activityCallHome = new Activity(ActivityType.Call, null, contact.NTHomeTelephoneNumber);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityCallHome,
              Properties.Localization.txtCMenuCallHome,
                contact.NTHomeTelephoneNumber,
                ((System.Drawing.Image)(Properties.Resources.listIconPhone)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            }

            if (contact.NTMobileTelephoneNumber != "")
            {
                //Call Mobile
                Activity activityCallMobile = new Activity(ActivityType.Call, null, contact.NTMobileTelephoneNumber);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityCallMobile,
                Properties.Localization.txtCMenuCallMobile,
                contact.NTMobileTelephoneNumber,
                ((System.Drawing.Image)(Properties.Resources.listIconPhone)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;


            }

            if (contact.NTBusinessTelephoneNumber != "")
            {
                //Call Business
                Activity activityCallBusiness = new Activity(ActivityType.Call, null, contact.NTBusinessTelephoneNumber);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityCallBusiness,
                Properties.Localization.txtCMenuCallWork,
                contact.NTBusinessTelephoneNumber,
                ((System.Drawing.Image)(Properties.Resources.listIconPhone)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            }

            if (contact.NTVoIPTelephoneNumber != "")
            {
                //Call VoIP
                Activity activityCallVoIP = new Activity(ActivityType.Call, null, contact.NTVoIPTelephoneNumber);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activityCallVoIP,
                 Properties.Localization.txtCmenuCallVoIP,
                contact.NTVoIPTelephoneNumber,
                ((System.Drawing.Image)(Properties.Resources.listIconPhone)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            }

            if (contact.NTEmail1Address != "")
            {
                //Send Email
                Activity activitySendEmail = new Activity(ActivityType.Email, null, contact.NTEmail1Address);
                lbxSearchResults.Items.Add(
                BuildRadMenuContentItem(
                activitySendEmail,
                Properties.Localization.txtCMenuSendEmail,
                contact.NTEmail1Address,
                ((System.Drawing.Image)(Properties.Resources.listIconEmail)),
                listSubItemSize,
                listSubItemNameFont,
                listSubItemDescriptionFont,
                Telerik.WinControls.ElementVisibility.Hidden
                )
                );
                itemsHeight += lbxSearchResults.Items[lbxSearchResults.Items.Count - 1].Size.Height;

            }

            if (lbxSearchResults.Items.Count > 1) lbxSearchResults.SelectedIndex = 1;
            else if (lbxSearchResults.Items.Count > 0) lbxSearchResults.SelectedIndex = 0;

            AdjustFormSize(itemsHeight);
        }
Example #19
0
 public void Logout()
 {
     _username = null;
     _password = null;
     _authorized = false;
     _jabberUser = null;
     Contact = null;
 }
Example #20
0
        public void loadArchiveUsersList(JabberUser selectedJabberUser)
        {
            List<Storage.StorageMessageArchiveUsers> list = mStorage.GetMessageArchiveUsers();
            tvUserList.Nodes.Clear();

            foreach (Storage.StorageMessageArchiveUsers item in list)
            {
                JabberUser jabberUser = new JabberUser(item.JID);

                TreeNode node = new TreeNode(jabberUser.Nick);
                node.Tag = jabberUser;
                node.ImageIndex = 0;
                tvUserList.Nodes.Add(node);
                if (selectedJabberUser != null && selectedJabberUser.JID == item.JID)
                {
                    if (tvUserList.SelectedNode != null && tvUserList.SelectedNode.Tag.ToString() == selectedJabberUser.JID)
                        continue;
                    tvUserList.SelectedNode = node;
                }
            }
            if (tvUserList.Nodes.Count == 0)
            {
                tvUserList.Nodes.Clear();
                TreeNode node = new TreeNode(Properties.Localization.txtArchiveInfoNoHistoryFound);
                tvUserList.Nodes.Add(node);
            }
            if (tvUserList.SelectedNode == null) tvUserList.SelectedNode = tvUserList.Nodes[0];

        }
Example #21
0
 public Activity(ActivityType activityType, JabberUser activityJabberUser, String activityOtherData)
 {
     ActivityType = activityType;
     ActivityOtherData = activityOtherData;
     ActivityJabberUser = activityJabberUser;
 }
Example #22
0
        private IQMessage IQMessage_StoreAvatar(JabberUser jabberUser, String imageBase64)
        {
            if (imageBase64 == null || imageBase64.Length > 0)
            {
                return null;
            }
            mPresenceAvatarSHA1 = SHA1_ComputeHexaHash(System.Convert.FromBase64String(imageBase64));
            String message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" type=\"set\" to=\"" + jabberUser.EscapedJID + "\"><query xmlns='storage:client:avatar'><data mimetype='image/jpeg'>" + imageBase64 + "</data></query></iq>";
            return new IQMessage(jabberUser.Domain, message);

        }
Example #23
0
        private void LoadContact(NTContact selectedMyContact)
        {
            if (selectedMyContact != null)
            {
                mNTContact = selectedMyContact;
            }
            else
            {
                mNTContact = new NTContact();
            }

            myContactJabberGroupListBox.Items.Clear();
            myContactJabberGroupListBox.Items.Add("");
            myContactJabberIMNetworkListBox.DataSource = Enum.GetValues(typeof(ConfigXMPPNetwork));
            myContactJabberIMNetworkListBox.SelectedIndex = 0;
            myContactStoreComboBox.Items.Clear();

            foreach (NTContactStore store in myClientForm.mContactBook.ContactStores)
            {
                if (store.Enabled)
                {
                    myContactStoreComboBox.Items.Add(store);
                }
                if (mNTContact.NTContactStore == store.StoreType) myContactStoreComboBox.SelectedItem = store;
            }

            myContactJabberIDInput.Text = mNTContact.NTJabberID;

            myContactFirstNameInput.Text = mNTContact.NTFirstName;
            myContactMiddleNameInput.Text = mNTContact.NTMiddleName;
            myContactLastNameInput.Text = mNTContact.NTLastName;
            myContactPhoneHomeInput.Text = mNTContact.NTHomeTelephoneNumber;
            myContactPhoneMobileInput.Text = mNTContact.NTMobileTelephoneNumber;
            myContactPhoneBusinessInput.Text = mNTContact.NTBusinessTelephoneNumber;
            myContactPhoneVoIPInput.Text = mNTContact.NTVoIPTelephoneNumber;

            myContactJabberIDInput.Text = mNTContact.NTJabberID;

            myContactAddressStreetInput.Text = mNTContact.NTHomeAddressStreet;
            myContactAddressCityInput.Text = mNTContact.NTHomeAddressCity;
            myContactAddressZipCodeInput.Text = mNTContact.NTHomeAddressPostalCode;
            myContactAddressStateInput.Text = mNTContact.NTHomeAddressState;
            myContactAddressCountryInput.Text = mNTContact.NTHomeAddressCountry;

            myContactAddressEmailInput.Text = mNTContact.NTEmail1Address;

            try
            {
                myContactPicture.Image = myContactPicture.Image = ImageProcessing.FixedSize(ImageProcessing.FromString(mNTContact.NTPicture), 64, 64);
            }
            catch (Exception)
            {

            }


            if (mProperties != null)
            {
                myContactFirstNameInput.Text = mProperties["NTFirstName"] != null ? mProperties["NTFirstName"].ToString() : mNTContact.NTFirstName;
                myContactMiddleNameInput.Text = mProperties["NTMiddleName"] != null ? mProperties["NTMiddleName"].ToString() : mNTContact.NTMiddleName;
                myContactLastNameInput.Text = mProperties["NTLastName"] != null ? mProperties["NTLastName"].ToString() : mNTContact.NTLastName;
                myContactPhoneHomeInput.Text = mProperties["NTHomeTelephoneNumber"] != null ? mProperties["NTHomeTelephoneNumber"].ToString() : mNTContact.NTHomeTelephoneNumber;
                myContactPhoneMobileInput.Text = mProperties["NTMobileTelephoneNumber"] != null ? mProperties["NTMobileTelephoneNumber"].ToString() : mNTContact.NTMobileTelephoneNumber;
                myContactPhoneBusinessInput.Text = mProperties["NTBusinessTelephoneNumber"] != null ? mProperties["NTBusinessTelephoneNumber"].ToString() : mNTContact.NTBusinessTelephoneNumber;
                myContactPhoneVoIPInput.Text = mProperties["NTVoIPTelephoneNumber"] != null ? mProperties["NTVoIPTelephoneNumber"].ToString() : mNTContact.NTVoIPTelephoneNumber;
                myContactJabberIDInput.Text = mProperties["NTJabberID"] != null ? mProperties["NTJabberID"].ToString() : mNTContact.NTJabberID;

                myContactAddressStreetInput.Text = mProperties["NTHomeAddressStreet"] != null ? mProperties["NTHomeAddressStreet"].ToString() : mNTContact.NTHomeAddressStreet;
                myContactAddressCityInput.Text = mProperties["NTHomeAddressCity"] != null ? mProperties["NTHomeAddressCity"].ToString() : mNTContact.NTHomeAddressCity;
                myContactAddressZipCodeInput.Text = mProperties["NTHomeAddressPostalCode"] != null ? mProperties["NTHomeAddressPostalCode"].ToString() : mNTContact.NTHomeAddressPostalCode;
                myContactAddressStateInput.Text = mProperties["NTHomeAddressState"] != null ? mProperties["NTHomeAddressState"].ToString() : mNTContact.NTHomeAddressState;
                myContactAddressCountryInput.Text = mProperties["NTHomeAddressCountry"] != null ? mProperties["NTHomeAddressCountry"].ToString() : mNTContact.NTHomeAddressCountry;

                myContactAddressEmailInput.Text = mProperties["NTEmail1Address"] != null ? mProperties["NTEmail1Address"].ToString() : mNTContact.NTEmail1Address;
            }

            foreach (DictionaryEntry group in myClientForm.myBuddyGroups)
            {
                if (group.Value.ToString() != "" && !myContactJabberGroupListBox.Items.Contains(group.Value.ToString()))
                    myContactJabberGroupListBox.Items.Add(group.Value.ToString());
            }

            JabberUser jabberUser = null;
            if (myContactJabberIDInput.Text != "")
            {
                jabberUser = new JabberUser(myContactJabberIDInput.Text);
                myContactJabberIDInput.Text = jabberUser.Username;
                myContactJabberIMNetworkListBox.SelectedItem = jabberUser.Network;
                myContactJabberGroupListBox.Text = myClientForm.myBuddyList[jabberUser.JID] != null ? myClientForm.myBuddyList[jabberUser.JID].ToString() : Properties.Localization.txtOtherGroup;
            }





            if (myClientForm.mUserAccount.Username == myContactJabberIDInput.Text)
            {
                myContactJabberIDInput.Enabled = false;
                myContactJabberGroupBox.Visible = false;

                myContactStoreComboBox.Enabled = false;
                myContactStoreComboBox.Visible = false;

                labelStore.Visible = false;
            }

        }
Example #24
0
 private IQMessage IQMessage_RequestVCard(JabberUser jabberUser, bool remote)
 {
     String message;
     if (remote)
     {
         message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" to=\"" + jabberUser.EscapedJID + "\" type=\"get\"><vCard xmlns=\"vcard-temp\"/></iq>";
     }
     else
     {
         message = "<iq id=\"" + mTag + "-" + mCounter.ToString() + "\" from=\"" + jabberUser.EscapedJID + "\" type=\"get\"><vCard xmlns=\"vcard-temp\"/></iq>";
     }
     return new IQMessage(jabberUser.Domain, message);
 }
Example #25
0
        public void AddNotification(String jid, String senderEvent, string messageText, DateTime messageDateTime, string messageGUID, bool flashWindow, bool forceChat)
        {
            if (InvokeRequired)
            {
                this.Invoke(new AddNotificationDelegate(this.AddNotification), new object[] { jid, senderEvent, messageText, messageDateTime, messageGUID, flashWindow });
                return;
            }

            //IMMessage parameters
            MessageStyle style = new MessageStyle(Color.White, new System.Drawing.Font("Trebuchet MS", 8.5F, System.Drawing.FontStyle.Regular), Color.Gray, Color.Gray);
            MessageTemplateType template = MessageTemplateType.Notification;
            ChatSession tmplChatSession = (ChatSession)myChatSessions[jid];
            JabberUser jabberUser = new JabberUser(jid);
            switch (senderEvent)
            {
                case "INFO":
                    senderEvent = "";
                    if (flashWindow) myClientForm.myNotifyIcon.ShowBalloonTip(10, jabberUser.Nick, messageText, ToolTipIcon.Info);
                    break;
                case "CLIENT":
                case "SERVER":
                case "PRESENCE":
                case "BUDDYUPDATE":
                    senderEvent = Properties.Localization.txtChatInfoSenderSystem;
                    break;
                case "NUDGE":
                    senderEvent = "";
                    myClientForm.mClientEvents.RaiseEvent(Remwave.Client.Events.ClientEvent.IncomingNudge);
                    FlashWindow(this.Handle, true);
                    #region Shake Window
                    Random rand = new Random();
                    int left = this.Left;
                    int top = this.Top;
                    for (int i = 0; i < 30; i++)
                    {
                        int randLeft = rand.Next(-10, 10);
                        int randTop = rand.Next(-10, 10);
                        this.Left = (left + randLeft) > 0 ? left + randLeft : 0;
                        this.Top = (top + randTop) > 0 ? left + randLeft : 0;
                        Thread.Sleep(50);
                    }
                    this.Left = left;
                    this.Top = top;
                    #endregion
                    break;
                case "INVITE":
                    senderEvent = Properties.Localization.txtChatInfoSenderUser;
                    myClientForm.mClientEvents.RaiseEvent(Remwave.Client.Events.ClientEvent.IncomingInstantMessage);
                    break;
            }

            if (forceChat && tmplChatSession == null)
            {
                try
                {
                    JabberUser chatJabberUser;
                    ContactList contactList = myClientForm.mContactBook.getCandidatesForJabberID(jid);
                    if (contactList.Count > 0)
                    {
                        NTContact ntContact = (NTContact)contactList[0];
                        chatJabberUser = new JabberUser(ntContact.NTJabberID, ntContact.NTNickname);
                    }
                    else
                    {
                        chatJabberUser = new JabberUser(jid);
                    }

                    NewChat(chatJabberUser, false);
                    tmplChatSession = (ChatSession)myChatSessions[chatJabberUser.JID];
                    if (tmplChatSession == null) return;
                }
                catch (Exception)
                {
                    return;
                }
            }

            //if chat session exist display content in conversation window
            if (tmplChatSession != null)
            {
                if (tmplChatSession.ChatBox.ChatTabConversation != null)
                {
                    IMMessage message = new IMMessage(senderEvent, messageText, messageGUID, messageDateTime, style, template, myEmoticons);
                    tmplChatSession.ChatBox.ChatTabConversation.Document.Body.InnerHtml += message.HTML;
                    tmplChatSession.ChatBox.ChatTabConversation.Document.Window.ScrollTo(0, tmplChatSession.ChatBox.ChatTabConversation.Document.Body.ScrollRectangle.Height);
                    tmplChatSession.ChatBox.AttachEvents();
                }
            }
        }
Example #26
0
 internal void PromptUser(JabberUser jabberUser)
 {
     this.OnSendIQMessage(IQMessage_Prompt(jabberUser), new EventArgs());
 }
Example #27
0
        public void NewChat(JabberUser jabberUser, bool setFocus)
        {
            int presenceStatus = 0;
            if (myClientForm.myBuddyPresence.Contains(jabberUser.JID)) presenceStatus = (int)myClientForm.myBuddyPresence[jabberUser.JID];

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChatWindow));

            if (myChatSessions[jabberUser.JID] == null)
            {
                ChatSession tmplChatSession = new ChatSession();
                ChatBox tmplChatBox = new ChatBox();
                tmplChatBox.JID = jabberUser.JID;
                tmplChatBox.ResetHTML();

                tmplChatSession.LastStatus = presenceStatus;
                tmplChatBox.wbConversation.GotFocus += new EventHandler(wbConversation_GotFocus);

                this.tmplChatTab = new Telerik.WinControls.UI.TabItem();

                //
                // tmplChatTab
                this.tmplChatTab.AccessibleDescription = "";
                this.tmplChatTab.CanFocus = true;
                this.tmplChatTab.Class = "TabItem";
                this.tmplChatTab.Tag = jabberUser.JID;
                this.tmplChatTab.ImageIndex = presenceStatus;
                this.tmplChatTab.TextImageRelation = TextImageRelation.ImageBeforeText;
                //
                // tmplChatTab.ContentPanel
                //
                this.tmplChatTab.ContentPanel.BackColor = System.Drawing.Color.Transparent;
                this.tmplChatTab.ContentPanel.Font = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Regular);
                this.tmplChatTab.ContentPanel.Location = new System.Drawing.Point(1, 22);
                this.tmplChatTab.ContentPanel.Name = "ContentPanel";
                this.tmplChatTab.ContentPanel.Size = new System.Drawing.Size(490, 241);
                this.tmplChatTab.ContentPanel.Dock = DockStyle.Fill;
                this.tmplChatTab.ContentPanel.TabIndex = 0;
                this.tmplChatTab.Text = jabberUser.Nick;
                this.tmplChatTab.ToolTipText = null;

                this.myChatSessionsTabControl.Items.AddRange(new Telerik.WinControls.RadItem[] { this.tmplChatTab });
                this.tmplChatTab.ContentPanel.BackgroundImage = null;
                this.tmplChatTab.ContentPanel.BackColor = Color.White;
                this.tmplChatTab.ContentPanel.Controls.Add(tmplChatBox);
                tmplChatBox.Dock = DockStyle.Fill;
                this.tmplChatTab.ContentPanel.Invalidate();

                //wire up all events

                tmplChatBox.toolStripCallUser.Click += new EventHandler(tmplVoiceCallToolStripButton_Click); ;
                tmplChatBox.toolStripColor.Click += new EventHandler(tmplChangeColorToolStripButton_Click); ;
                tmplChatBox.toolStripEmotSmile.Click += new EventHandler(tmplEmoticonSmileToolStripButton_Click); ;
                tmplChatBox.toolStripEvilgrin.Click += new EventHandler(tmplEmoticonEvilGrinToolStripButton_Click); ;
                tmplChatBox.toolStripFont.Click += new EventHandler(tmplChangeFontToolStripButton_Click);
                tmplChatBox.toolStripGrin.Click += new EventHandler(tmplEmoticonGrinToolStripButton_Click); ;
                tmplChatBox.toolStripHappy.Click += new EventHandler(tmplEmoticonHappyToolStripButton_Click); ;
                tmplChatBox.toolStripOpenArchive.Click += new EventHandler(toolStripOpenArchive_Click); ;
                tmplChatBox.toolStripSendMessage.Click += new EventHandler(tmplSendMessageToolStripButton_Click); ;
                tmplChatBox.toolStripStartVideo.Click += new EventHandler(tmplVideoCallToolStripButton_Click); ;
                tmplChatBox.toolStripSurprised.Click += new EventHandler(tmplEmoticonSurprisedToolStripButton_Click); ;
                tmplChatBox.toolStripTongue.Click += new EventHandler(tmplEmoticonToungeToolStripButton_Click); ;
                tmplChatBox.toolStripUnhappy.Click += new EventHandler(tmplEmoticonUnhappyToolStripButton_Click); ;
                tmplChatBox.toolStripWaii.Click += new EventHandler(tmplEmoticonWaiiToolStripButton_Click); ;
                tmplChatBox.toolStripWink.Click += new EventHandler(tmplEmoticonWinkToolStripButton_Click); ;
                tmplChatBox.toolStripSendNudge.Click += new EventHandler(toolStripSendNudge_Click);
                tmplChatBox.toolStripSendFile.Click += new EventHandler(toolStripSendFile_Click);
                tmplChatBox.tbMessage.KeyUp += new KeyEventHandler(tmplChatTabMessage_KeyUp);

                //disable foreign networks features
                if (jabberUser.Network != ConfigXMPPNetwork.Default)
                {
                    tmplChatBox.toolStripCallUser.Enabled = false;
                    tmplChatBox.toolStripStartVideo.Enabled = false;
                    tmplChatBox.toolStripSendNudge.Enabled = false;
                    tmplChatBox.toolStripSendFile.Enabled = false;
                    tmplChatBox.toolStripCallUser.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripStartVideo.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripSendNudge.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripSendFile.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                }

#if NOVIDEO
                tmplChatBox.toolStripStartVideo.Visible = false;
                tmplChatBox.toolStripStartVideo.Enabled = false;
#endif
#if NOFILESHARING
                tmplChatBox.toolStripSendFile.Visible = false;
                tmplChatBox.toolStripSendFile.Enabled = false;
#endif

                tmplChatBox.LinkClicked += new ChatBox.LinkClickedHandler(tmplChatBox_LinkClicked);
                tmplChatBox.FileDroped += new ChatBox.FilesDropedHandler(tmplChatBox_FileDroped);

                this.myChatSessionsTabControl.SelectedTab = this.tmplChatTab;

                this.tmplChatTab.ContentPanel.ResumeLayout(true);

                RadButtonElement tmplCloseButton = new RadButtonElement("x");
                tmplCloseButton.ToolTipText = Properties.Localization.txtChatInfoCloseTab;
                tmplCloseButton.Tag = jabberUser.JID;
                tmplCloseButton.Click += new EventHandler(tmplCloseButton_Click);

                tmplCloseButton.Alignment = ContentAlignment.TopRight;
                tmplChatTab.Children[2].Margin = new Padding(0, 0, 15, 0);
                tmplChatTab.Children.Add(tmplCloseButton);

                tmplChatSession.ChatTab = tmplChatTab;
                tmplChatSession.ChatBox = tmplChatBox;
                tmplChatSession.JabberUser = jabberUser;

                myChatSessions.Add(jabberUser.JID, tmplChatSession);
                Search("%");
                tmplChatSession.ChatBox.ChatTabMessage.Focus();
            }
            else
            {
                ChatSession tmplChatSession = (ChatSession)myChatSessions[jabberUser.JID];
                myChatSessionsTabControl.SelectedTab = tmplChatSession.ChatTab;
            }

            if (myClientForm.mUserAccount.LoggedIn)
            {
                ShowIt();
            }

        }
Example #28
0
 internal void AvatarStore(JabberUser jabberUser, String imageBase64)
 {
     this.OnSendIQMessage(IQMessage_StoreAvatar(jabberUser, imageBase64), new EventArgs());
 }
Example #29
0
        public void AddToConversation(String chatJID, String senderJID, string messageText, string messageHTML, DateTime messageDateTime, string messageGUID, bool forceEmpty, bool flashWindow)
        {

            if (InvokeRequired)
            {
                this.Invoke(new AddToConversationDelegate(this.AddToConversation), new object[] { chatJID, senderJID, messageText, messageDateTime, messageGUID, forceEmpty, flashWindow });
                return;
            }

            //IMMessage parameters

            MessageStyle style = new MessageStyle(Color.White, new System.Drawing.Font("Trebuchet MS", 8.5F, System.Drawing.FontStyle.Regular), Color.Gray, Color.Gray);
            MessageTemplateType template = MessageTemplateType.Notification;
            ChatSession tmplChatSession = (ChatSession)myChatSessions[chatJID];
            JabberUser chatJabberUser = null;
            JabberUser senderJabberUser = null;

            if (tmplChatSession == null)
            {
                try
                {
                    ContactList contactList = myClientForm.mContactBook.getCandidatesForJabberID(chatJID);
                    if (contactList.Count > 0)
                    {
                        NTContact ntContact = (NTContact)contactList[0];
                        chatJabberUser = new JabberUser(ntContact.NTJabberID, ntContact.NTNickname);
                    }
                    else
                    {
                        chatJabberUser = new JabberUser(chatJID);
                    }

                    NewChat(chatJabberUser, false);
                    tmplChatSession = (ChatSession)myChatSessions[chatJabberUser.JID];
                    if (tmplChatSession == null) return;
                }
                catch (Exception)
                {
                    return;
                }
            }
            if (forceEmpty)
            {
                tmplChatSession.ChatBox.ResetHTML();
            }
            if (senderJID == myClientForm.mUserAccount.JabberUser.JID)
            {
                //outgoing message
                senderJabberUser = myClientForm.mUserAccount.JabberUser;
                style = tmplChatSession.OutgoingStyle;
                template = MessageTemplateType.Out;

            }
            else
            { //incomming message
                senderJabberUser = tmplChatSession.JabberUser;
                if (flashWindow)
                {
                    FlashWindow(this.Handle, true);
                    myClientForm.mClientEvents.RaiseEvent(Remwave.Client.Events.ClientEvent.IncomingInstantMessage);
                    ShowIt();
                    mMessageInTimeout = 360;
                    myNotifyIcon.Visible = true;
                }
                style = tmplChatSession.IncomingStyle;
                template = MessageTemplateType.In;
            }

            //if chat session exist display content in conversation window
            if (tmplChatSession != null)
            {
                if (tmplChatSession.ChatBox.ChatTabConversation != null)
                {
                    SetComposing(false, senderJID);
                    if (messageHTML == "") messageHTML = messageText;

                    IMMessage message = new IMMessage(senderJabberUser.Nick, messageHTML, messageGUID, messageDateTime, style, template, myEmoticons);
                    tmplChatSession.ChatBox.ChatTabConversation.Document.Body.InnerHtml += message.HTML;
                    tmplChatSession.ChatBox.ChatTabConversation.Document.Window.ScrollTo(0, tmplChatSession.ChatBox.ChatTabConversation.Document.Body.ScrollRectangle.Height);
                    tmplChatSession.ChatBox.AttachEvents();
                }
            }
        }
Example #30
0
 internal void StoreVCard(JabberUser jabberUser, NTContact contact)
 {
     this.OnSendIQMessage(IQMessage_StoreVCard(jabberUser, contact), new EventArgs());
 }
Example #31
0
        internal void IncomingMessage(String jid, String messageText, String messageHTML)
        {
            if (messageText != "" || messageHTML != "")
            {
                JabberUser jabberUser = new JabberUser(jid);

                IMMessage messageIncoming = new IMMessage(jabberUser.Nick, messageText, Guid.NewGuid().ToString(), DateTime.Now, new MessageStyle(), MessageTemplateType.Incoming, null);
                AddToConversation(jabberUser.JID, jabberUser.JID, messageIncoming.Text, messageIncoming.HTML, messageIncoming.Time, messageIncoming.ID, false, true);
                myClientForm.myStorage.AddMessageToArchive(jabberUser.JID, myClientForm.myStorage.StorageGUID(), messageIncoming.Text, messageIncoming.HTML, false);
                SetComposing(false, jabberUser.JID);

#if(TRACE)
                Console.WriteLine("IM-Message:" + "(" + jabberUser.JID + ")" + messageIncoming.Text);
#endif
            }
        }
Example #32
0
 internal void Remove(JabberUser jabberUser)
 {
     this.OnSendIQMessage(IQMessage_Remove(jabberUser), new EventArgs());
 }
Example #33
0
        private void myContactSaveCloseButton_Click(object sender, EventArgs e)
        {
            Accepted = true;

            myNTContact.NTContactChanged = true;
            myNTContact.NTContactStore = (NTContactStore)comboBox1.SelectedItem;

            myNTContact.NTFirstName = myContactFirstNameInput.Text;
            myNTContact.NTMiddleName = myContactMiddleNameInput.Text;
            myNTContact.NTLastName = myContactLastNameInput.Text;

            myNTContact.NTHomeTelephoneNumber = myContactPhoneHomeInput.Text;
            myNTContact.NTMobileTelephoneNumber = myContactPhoneMobileInput.Text;
            myNTContact.NTBusinessTelephoneNumber = myContactPhoneBusinessInput.Text;
            myNTContact.NTVoIPTelephoneNumber = myContactPhoneVoIPInput.Text; ;

           
            myNTContact.NTJabberID = "";
            if (myContactJabberIDInput.Text != "")
            {
                JabberUser jabberUser;
                ConfigXMPPNetwork selectedIMNetwork = ConfigXMPPNetwork.Nikotel;
                try
                {
                    selectedIMNetwork = (ConfigXMPPNetwork)myContactJabberIMNetworkListBox.SelectedItem;
                }
                catch (Exception)
                {

                    selectedIMNetwork = ConfigXMPPNetwork.Nikotel;
                }

                String domain = ConfigIM.GetXMPPDomain(selectedIMNetwork);
                jabberUser = new JabberUser(myContactJabberIDInput.Text.Replace(@"@", @"\40") + @"@" + domain);
           

            myNTContact.NTJabberID = jabberUser.JID;
            myNTContact.NTUsername = jabberUser.Username;
            myNTContact.NTNickname = jabberUser.Nick;
        }

            myNTContact.NTHomeAddressStreet = myContactAddressStreetInput.Text;
            myNTContact.NTHomeAddressCity = myContactAddressCityInput.Text;
            myNTContact.NTHomeAddressPostalCode = myContactAddressZipCodeInput.Text;
            myNTContact.NTHomeAddressState = myContactAddressStateInput.Text;
            myNTContact.NTHomeAddressCountry = myContactAddressCountryInput.Text;

            myNTContact.NTEmail1Address = myContactAddressEmailInput.Text;

            if (mContactBook.IndexOf(myNTContact) < 0)
            {
                mContactBook.Add(myNTContact);
            }
            this.Close();
        }