Add length validation foe caption

This commit is contained in:
omarm 2017-04-13 11:33:46 +03:00
parent 1697db9d7f
commit 6faba0f286
2 changed files with 34 additions and 23 deletions

View file

@ -269,7 +269,7 @@ namespace TLSharp.Core
random_id = Helpers.GenerateRandomLong(),
background = false,
clear_draft = false,
media = new TLInputMediaUploadedPhoto() { file = file, caption = caption },
media = new TLInputMediaUploadedPhoto() { file = file, Caption = caption },
peer = peer
});
}

View file

@ -20,7 +20,18 @@ namespace TeleSharp.TL
public int flags { get; set; }
public TLAbsInputFile file { get; set; }
public string caption {get;set;}
private string caption;
public string Caption
{
get { return caption; }
set
{
caption = value.Length > 200 ? value.Remove(199, value.Length - 199) : value;
}
}
public TLVector<TLAbsInputDocument> stickers { get; set; }