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))
|
if (!string.IsNullOrEmpty(url))
|
||||||
{
|
{
|
||||||
url = URLHelpers.URLEncode(url);
|
string encodedUrl = URLHelpers.URLEncode(url);
|
||||||
|
|
||||||
switch (Info.TaskSettings.SocialNetworkingServiceDestination)
|
switch (Info.TaskSettings.SocialNetworkingServiceDestination)
|
||||||
{
|
{
|
||||||
|
@ -1031,24 +1031,23 @@ public void DoSocialNetworkingService()
|
||||||
|
|
||||||
if (twitterOAuth != null)
|
if (twitterOAuth != null)
|
||||||
{
|
{
|
||||||
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth))
|
using (TwitterTweetForm twitter = new TwitterTweetForm(twitterOAuth, " " + url))
|
||||||
{
|
{
|
||||||
twitter.Message = url;
|
|
||||||
twitter.ShowDialog();
|
twitter.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SocialNetworkingService.Facebook:
|
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;
|
break;
|
||||||
case SocialNetworkingService.GooglePlus:
|
case SocialNetworkingService.GooglePlus:
|
||||||
URLHelpers.OpenURL("https://plus.google.com/share?url=" + url);
|
URLHelpers.OpenURL("https://plus.google.com/share?url=" + encodedUrl);
|
||||||
break;
|
break;
|
||||||
case SocialNetworkingService.VK:
|
case SocialNetworkingService.VK:
|
||||||
URLHelpers.OpenURL("http://vk.com/share.php?url=" + url);
|
URLHelpers.OpenURL("http://vk.com/share.php?url=" + encodedUrl);
|
||||||
break;
|
break;
|
||||||
case SocialNetworkingService.Pinterest:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public string Message
|
||||||
{
|
{
|
||||||
return txtTweet.Text;
|
return txtTweet.Text;
|
||||||
}
|
}
|
||||||
set
|
private set
|
||||||
{
|
{
|
||||||
txtTweet.Text = value;
|
txtTweet.Text = value;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,12 @@ public TwitterTweetForm(OAuthInfo oauth)
|
||||||
AuthInfo = oauth;
|
AuthInfo = oauth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TwitterTweetForm(OAuthInfo oauth, string message)
|
||||||
|
: this(oauth)
|
||||||
|
{
|
||||||
|
Message = message;
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateLength()
|
private void UpdateLength()
|
||||||
{
|
{
|
||||||
lblTweetLength.Text = (Length - Message.Length).ToString();
|
lblTweetLength.Text = (Length - Message.Length).ToString();
|
||||||
|
@ -123,6 +129,7 @@ private void SendTweet()
|
||||||
|
|
||||||
private void TwitterMsg_Shown(object sender, EventArgs e)
|
private void TwitterMsg_Shown(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
txtTweet.SelectionLength = 0;
|
||||||
this.ShowActivate();
|
this.ShowActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue