Put the replace back in, only this time used replaceFirst() as I should have done in the first place. So now the toot posted is cleaner, without the spurious " . ".

This commit is contained in:
PhotonQyv 2017-08-10 21:45:11 +01:00
parent 0b1fcd16c0
commit 7592f83b9a
1 changed files with 17 additions and 2 deletions

View File

@ -359,9 +359,24 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
if( toot_cw_content.getText().toString().trim().length() > 0)
toot.setSpoiler_text(toot_cw_content.getText().toString().trim());
toot.setVisibility(visibility);
toot.setContent(toot_content.getText().toString().trim());
if( tootReply != null)
if( tootReply != null) {
toot.setIn_reply_to_id(tootReply.getId());
/*
Strip the first appearance of " . "
that we added to get capitalisation,
from toot before posting it. Makes
the end toot cleaner.
*/
String preToot = toot_content.getText().toString().trim();
String postToot = preToot.replaceFirst(" . ", "");
toot.setContent(postToot.trim());
}else {
toot.setContent(toot_content.getText().toString().trim());
}
new PostStatusAsyncTask(getApplicationContext(), toot, TootActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}