diff options
| author | Cho <cho@lindenlab.com> | 2013-11-12 22:18:05 +0000 | 
|---|---|---|
| committer | Cho <cho@lindenlab.com> | 2013-11-12 22:18:05 +0000 | 
| commit | 9e6dd1811e890d6d5e23059c67f13d9960e56366 (patch) | |
| tree | 94d9b79394d666224333613be60c8b41f1b429ff | |
| parent | 9946965c4decd59793adcaa39c70dbf9778d61dd (diff) | |
implemented Twitter character limits for status text box for ACME-1171 and ACME-1172
| -rw-r--r-- | indra/newview/llfloatertwitter.cpp | 13 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_twitter_photo.xml | 2 | 
2 files changed, 14 insertions, 1 deletions
| diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 0da0d64426..46cad7ec45 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -47,6 +47,7 @@  #include "llviewercontrol.h"  #include "llviewermedia.h"  #include "lltabcontainer.h" +#include "lltexteditor.h"  static LLRegisterPanelClassWrapper<LLTwitterPhotoPanel> t_panel_photo("lltwitterphotopanel");  static LLRegisterPanelClassWrapper<LLTwitterAccountPanel> t_panel_account("lltwitteraccountpanel"); @@ -112,6 +113,18 @@ void LLTwitterPhotoPanel::draw()  	bool add_photo = mPhotoCheckbox->getValue().asBoolean(); +	// Restrict the status text length to Twitter's character limit +	LLTextEditor* status_text_box = dynamic_cast<LLTextEditor*>(mStatusTextBox); +	if (status_text_box) +	{ +		int max_status_length = add_photo ? 119 : 140; +		status_text_box->setMaxTextLength(max_status_length); +		if (status_text_box->getText().length() > max_status_length) +		{ +			status_text_box->setText(status_text_box->getText().substr(0, max_status_length)); +		} +	} +      // Display the preview if one is available  	if (previewp && previewp->getThumbnailImage())  	{ diff --git a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml index 84206c608b..fd2bffe675 100644 --- a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml @@ -31,7 +31,7 @@             width="250"             left="9"             length="1" -           max_length="700" +           max_length="119"             name="photo_status"             type="string"             word_wrap="true"> | 
