📄 sendrequestform.cs
字号:
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.CannotAddYouself);
return;
}
IicUri uri2 = IicUri.CreateSidUri(sid);
Imps.Client.Core.Contact contact2 = this._user.ContactList.Contacts[uri2.Raw];
if (contact2 == null)
{
goto Label_05B0;
}
int? nullable5 = contact2.RelationStatus;
if (!((nullable5.GetValueOrDefault() == 1) && nullable5.get_HasValue()))
{
goto Label_05B0;
}
string text7 = string.Empty;
using (IEnumerator<int> enumerator2 = contact2.BelongToGroups.GetEnumerator())
{
while (enumerator2.MoveNext())
{
int num3 = enumerator2.get_Current();
Imps.Client.Core.ContactGroup group2 = this._user.ContactList.Groups[new int?(num3)] as Imps.Client.Core.ContactGroup;
if (group2 != null)
{
text7 = StringHelper.GetPaddingStringEndEllipsis(group2.Name, 20);
goto Label_0555;
}
}
}
Label_0555:
if (text7.Length > 0)
{
text8 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy_WithGroup, contact2.DisplayName.Replace("&", "&&"), text7);
}
else
{
text8 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy, contact2.DisplayName);
}
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, text8);
return;
Label_05B0:
isByMobileNo = false;
id = uri2.Sid.ToString();
Label_05C3:
targetGroupId = nullable;
if (this._lastContact == null)
{
localName = string.Empty;
}
else
{
localName = (this._lastContact.PersonalInfo.Nickname == this.xTextBoxNickname.Text.Trim()) ? string.Empty : this.xTextBoxNickname.Text.Trim();
}
extraData = new Imps.Client.Core.ContactList.AddBuddyExtraData();
extraData.WhoAmI = this.textBoxMyName.Text.Trim();
sendRequestAgain = true;
copyWhenExist = true;
invite = null;
goto Label_0A80;
Label_064D:
if (this.tabControlAddBuddy.SelectedIndex != 1)
{
goto Label_0A80;
}
domain = "vodafone";
if (!this.radioButtonMobileNoV.Checked)
{
goto Label_0896;
}
if (this.xTextBoxMobileNoV.Text.Trim().Length == 0)
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.AddBuddy_MobileNoEmpty);
this.xTextBoxMobileNoV.Focus();
return;
}
if (!this.xTextBoxMobileNoV.Text.Trim().StartsWith("+"))
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.InvalidInternalMobileNo);
this.xTextBoxMobileNoV.Focus();
return;
}
string mobileNo = this.xTextBoxMobileNoV.Text.Trim();
if (mobileNo == this._user.PersonalInfo.MobileNo)
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.CannotAddYouself);
return;
}
Imps.Client.Core.Contact contact3 = this._user.ContactList.FindContactByMsisdnEx(mobileNo);
if (contact3 == null)
{
goto Label_0853;
}
int? nullable6 = contact3.RelationStatus;
if (!((nullable6.GetValueOrDefault() == 1) && nullable6.get_HasValue()))
{
goto Label_0853;
}
string text10 = string.Empty;
using (IEnumerator<int> enumerator3 = contact3.BelongToGroups.GetEnumerator())
{
while (enumerator3.MoveNext())
{
int num4 = enumerator3.get_Current();
Imps.Client.Core.ContactGroup group3 = this._user.ContactList.Groups[new int?(num4)] as Imps.Client.Core.ContactGroup;
if (group3 != null)
{
text10 = StringHelper.GetPaddingStringEndEllipsis(group3.Name, 20);
goto Label_07E9;
}
}
}
Label_07E9:
if (text10.Length > 0)
{
text11 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy_WithGroup, contact3.DisplayName.Replace("&", "&&"), text10);
}
else
{
text11 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy, contact3.DisplayName.Replace("&", "&&"));
}
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, text11);
return;
Label_0853:
isByMobileNo = true;
id = this.xTextBoxMobileNoV.Text.Trim();
targetGroupId = nullable;
localName = string.Empty;
extraData = new Imps.Client.Core.ContactList.AddBuddyExtraData();
extraData.WhoAmI = string.Empty;
sendRequestAgain = true;
copyWhenExist = false;
invite = null;
goto Label_0A6E;
Label_0896:
if (this.xTextBoxSIDV.Text.Trim().Length == 0)
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.PlsInputVodafoneMessengerID);
this.xTextBoxSIDV.Focus();
return;
}
long num5 = Convert.ToInt64(this.xTextBoxSIDV.Text);
if (num5 == this._user.Sid)
{
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.CannotAddYouself);
return;
}
IicUri uri3 = IicUri.CreateSidUri(num5, "vodafone");
Imps.Client.Core.Contact contact4 = this._user.ContactList.Contacts[uri3.Raw];
if (contact4 == null)
{
goto Label_0A30;
}
int? nullable7 = contact4.RelationStatus;
if (!((nullable7.GetValueOrDefault() == 1) && nullable7.get_HasValue()))
{
goto Label_0A30;
}
string text12 = string.Empty;
using (IEnumerator<int> enumerator4 = contact4.BelongToGroups.GetEnumerator())
{
while (enumerator4.MoveNext())
{
int num6 = enumerator4.get_Current();
Imps.Client.Core.ContactGroup group4 = this._user.ContactList.Groups[new int?(num6)] as Imps.Client.Core.ContactGroup;
if (group4 != null)
{
text12 = StringHelper.GetPaddingStringEndEllipsis(group4.Name, 20);
goto Label_09D5;
}
}
}
Label_09D5:
if (text12.Length > 0)
{
text13 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy_WithGroup, contact4.DisplayName.Replace("&", "&&"), text12);
}
else
{
text13 = string.Format(StringTable.Contact.ContactAlreadyExistInBuddy, contact4.DisplayName);
}
this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, text13);
return;
Label_0A30:
isByMobileNo = false;
id = uri3.Sid.ToString();
targetGroupId = nullable;
localName = string.Empty;
extraData = new Imps.Client.Core.ContactList.AddBuddyExtraData();
extraData.WhoAmI = string.Empty;
sendRequestAgain = true;
copyWhenExist = false;
invite = null;
Label_0A6E:
localName = this.xTextBoxNicknameV.Text.Trim();
Label_0A80:
op.Successed += new EventHandler(this.op_Successed);
op.ImpsError += new EventHandler<ImpsErrorEventArgs>(this, (IntPtr) this.op_ImpsError);
this._user.ContactList.AsyncAddBuddy(isByMobileNo, id, domain, targetGroupId, localName, extraData, sendRequestAgain, copyWhenExist, invite, op);
this.buttonCancel.Enabled = true;
this.tabControlAddBuddy.Enabled = false;
}
catch
{
}
}
private void checkSID(object sender, EventArgs e)
{
lock (locker)
{
if (!this._checkSID || (DateTime.Now.Subtract(this._textCheckedTime).TotalMilliseconds < 400))
{
return;
}
this._checkSID = false;
this._textCheckedTime = DateTime.Now;
}
this.findContactByMobileOrSid(false);
}
private void clearContactInfo()
{
this.xTextBoxNickname.Text = string.Empty;
this.pictureBoxPortrait.Visible = false;
this.pictureBoxPortrait.Image = ImpsPortrait.GetDefaultPortrait(0x18, 0x18);
this.linkLabelDetail.Visible = false;
this.labelAlert.Visible = false;
}
private void contactInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
if (e.ContainsProperty("nickname"))
{
this.showContactInfo(((Imps.Client.Core.ContactInfo) sender).Owner.PersonalInfo);
}
else if (e.ContainsProperty("Provision"))
{
this.showContactInfo(((Imps.Client.Core.ContactInfo) sender).Owner.PersonalInfo);
}
}
private void ContactList_ContactGroupChanged(object sender, ContactGroupChangedEventArgs e)
{
if (e.Type == ContactGroupEventType.Added)
{
this._initTargetGroupId = new int?(e.ContactGroup.Id);
this._initTargetGroupIdV = new int?(e.ContactGroup.Id);
}
else if (e.Type == ContactGroupEventType.Deleted)
{
int? nullable = this._initTargetGroupId;
if ((e.ContactGroup.Id == nullable.GetValueOrDefault()) && nullable.get_HasValue())
{
this._initTargetGroupId = null;
}
int? nullable2 = this._initTargetGroupIdV;
if ((e.ContactGroup.Id == nullable2.GetValueOrDefault()) && nullable2.get_HasValue())
{
this._initTargetGroupIdV = null;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -