Skip to content

Commit 39c2e10

Browse files
committed
Make sure we count URL for "quote with image and no text"
1 parent f671cfe commit 39c2e10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util/TweetUtils.vala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,12 @@ namespace TweetUtils {
167167
public int calc_tweet_length (string text, bool add_url = false) {
168168
int length = 0;
169169

170+
if (add_url)
171+
length += 1 + Twitter.short_url_length_https;
172+
170173
/* trailing & laeding whitespace don't count unless there's other text */
171174
if (text.strip ().length == 0) {
172-
return 0;
175+
return length;
173176
}
174177

175178
unichar c;
@@ -203,9 +206,6 @@ namespace TweetUtils {
203206
cur = next;
204207
}
205208

206-
if (add_url)
207-
length += 1 + Twitter.short_url_length_https;
208-
209209
return length;
210210
}
211211

0 commit comments

Comments
 (0)