Twitter image upload will allow tweeting with empty text

This commit is contained in:
Jaex 2015-06-19 00:19:19 +03:00
parent 92710686cb
commit 050adb2cc8
2 changed files with 26 additions and 3 deletions

View file

@ -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)

View file

@ -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)