mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Twitter fix
This commit is contained in:
parent
18a3dedd80
commit
2b29b3e125
2 changed files with 14 additions and 8 deletions
|
@ -1022,7 +1022,7 @@ public void DoSocialNetworkingService()
|
|||
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
url = URLHelpers.URLEncode(url);
|
||||
string encodedUrl = URLHelpers.URLEncode(url);
|
||||
|
||||
switch (Info.TaskSettings.SocialNetworkingServiceDestination)
|
||||
{
|
||||
|
@ -1031,24 +1031,23 @@ public void DoSocialNetworkingService()
|
|||
|
||||
if (twitterOAuth != null)
|
||||
{
|
||||
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth))
|
||||
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth, " " + url))
|
||||
{
|
||||
twitter.Message = url;
|
||||
twitter.ShowDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SocialNetworkingService.Facebook:
|
||||
URLHelpers.OpenURL("https://www.facebook.com/sharer/sharer.php?u=" + url);
|
||||
URLHelpers.OpenURL("https://www.facebook.com/sharer/sharer.php?u=" + encodedUrl);
|
||||
break;
|
||||
case SocialNetworkingService.GooglePlus:
|
||||
URLHelpers.OpenURL("https://plus.google.com/share?url=" + url);
|
||||
URLHelpers.OpenURL("https://plus.google.com/share?url=" + encodedUrl);
|
||||
break;
|
||||
case SocialNetworkingService.VK:
|
||||
URLHelpers.OpenURL("http://vk.com/share.php?url=" + url);
|
||||
URLHelpers.OpenURL("http://vk.com/share.php?url=" + encodedUrl);
|
||||
break;
|
||||
case SocialNetworkingService.Pinterest:
|
||||
URLHelpers.OpenURL(string.Format("http://pinterest.com/pin/create/button/?url={0}&media={0}", url));
|
||||
URLHelpers.OpenURL(string.Format("http://pinterest.com/pin/create/button/?url={0}&media={0}", encodedUrl));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public string Message
|
|||
{
|
||||
return txtTweet.Text;
|
||||
}
|
||||
set
|
||||
private set
|
||||
{
|
||||
txtTweet.Text = value;
|
||||
}
|
||||
|
@ -86,6 +86,12 @@ public TwitterTweetForm(OAuthInfo oauth)
|
|||
AuthInfo = oauth;
|
||||
}
|
||||
|
||||
public TwitterTweetForm(OAuthInfo oauth, string message)
|
||||
: this(oauth)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
|
||||
private void UpdateLength()
|
||||
{
|
||||
lblTweetLength.Text = (Length - Message.Length).ToString();
|
||||
|
@ -123,6 +129,7 @@ private void SendTweet()
|
|||
|
||||
private void TwitterMsg_Shown(object sender, EventArgs e)
|
||||
{
|
||||
txtTweet.SelectionLength = 0;
|
||||
this.ShowActivate();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue