diff options
Diffstat (limited to 'indra')
| -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">  | 
