mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Twitter image upload will allow tweeting with empty text
This commit is contained in:
parent
92710686cb
commit
050adb2cc8
2 changed files with 26 additions and 3 deletions
|
@ -65,7 +65,30 @@ public bool IsValidMessage
|
|||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(Message) && Message.Length <= Length;
|
||||
return Message != null && (MediaMode || Message.Length > 0) && Message.Length <= Length;
|
||||
}
|
||||
}
|
||||
|
||||
private bool mediaMode;
|
||||
|
||||
public bool MediaMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return mediaMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
mediaMode = value;
|
||||
|
||||
if (mediaMode)
|
||||
{
|
||||
Length = Twitter.MessageMediaLimit;
|
||||
}
|
||||
else
|
||||
{
|
||||
Length = Twitter.MessageLimit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +100,7 @@ public TwitterTweetForm()
|
|||
{
|
||||
InitializeComponent();
|
||||
Icon = Resources.Twitter;
|
||||
Length = Twitter.MessageLimit;
|
||||
MediaMode = false;
|
||||
}
|
||||
|
||||
public TwitterTweetForm(OAuthInfo oauth)
|
||||
|
|
|
@ -67,7 +67,7 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
{
|
||||
using (TwitterTweetForm twitterMsg = new TwitterTweetForm())
|
||||
{
|
||||
twitterMsg.Length = MessageMediaLimit;
|
||||
twitterMsg.MediaMode = true;
|
||||
twitterMsg.Message = DefaultMessage;
|
||||
|
||||
if (twitterMsg.ShowDialog() != DialogResult.OK)
|
||||
|
|
Loading…
Reference in a new issue