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 /indra/newview/llfloatertwitter.cpp | |
parent | 9946965c4decd59793adcaa39c70dbf9778d61dd (diff) |
implemented Twitter character limits for status text box for ACME-1171 and ACME-1172
Diffstat (limited to 'indra/newview/llfloatertwitter.cpp')
-rw-r--r-- | indra/newview/llfloatertwitter.cpp | 13 |
1 files changed, 13 insertions, 0 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()) { |