Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    rc43146d r33528bd  
    483483}
    484484
    485 static gboolean twitter_length_check(struct im_connection *ic, gchar * msg)
    486 {
    487         int max = set_getint(&ic->acc->set, "message_length"), len;
    488         int target_len = set_getint(&ic->acc->set, "target_url_length");
     485int twitter_message_len(gchar *msg, int target_len)
     486{
    489487        int url_len_diff = 0;
    490488
     
    493491        }
    494492
    495         if (max == 0 || (len = g_utf8_strlen(msg, -1) + url_len_diff) <= max) {
     493        return g_utf8_strlen(msg, -1) + url_len_diff;
     494}
     495
     496static gboolean twitter_length_check(struct im_connection *ic, gchar * msg)
     497{
     498        int max = set_getint(&ic->acc->set, "message_length");
     499        int target_len = set_getint(&ic->acc->set, "target_url_length");
     500        int len = twitter_message_len(msg, target_len);
     501
     502        if (max == 0 || len <= max) {
    496503                return TRUE;
    497504        }
Note: See TracChangeset for help on using the changeset viewer.