We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f671cfe commit 39c2e10Copy full SHA for 39c2e10
src/util/TweetUtils.vala
@@ -167,9 +167,12 @@ namespace TweetUtils {
167
public int calc_tweet_length (string text, bool add_url = false) {
168
int length = 0;
169
170
+ if (add_url)
171
+ length += 1 + Twitter.short_url_length_https;
172
+
173
/* trailing & laeding whitespace don't count unless there's other text */
174
if (text.strip ().length == 0) {
- return 0;
175
+ return length;
176
}
177
178
unichar c;
@@ -203,9 +206,6 @@ namespace TweetUtils {
203
206
cur = next;
204
207
205
208
- if (add_url)
- length += 1 + Twitter.short_url_length_https;
-
209
return length;
210
211
0 commit comments