Changeset fa9478e


Ignore:
Timestamp:
2013-08-02T15:30:11Z (11 years ago)
Author:
unknown <pesco@…>
Branches:
master
Children:
37ed402
Parents:
22ec21d
Message:

better workaround for libotr's NULL opdata bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    r22ec21d rfa9478e  
    665665int op_max_message_size(void *opdata, ConnContext *context)
    666666{
    667         /* libotr 4.0.0 has a bug where it doesn't set opdata */
    668         if(!opdata) {
    669                 /* crude fallback */
    670                 return 800;
    671         }
    672 
    673667        struct im_connection *ic =
    674668                check_imc(opdata, context->accountname, context->protocol);
     
    13701364        struct im_connection *ic = (struct im_connection *)opdata;
    13711365
     1366        /* libotr 4.0.0 has a bug where it doesn't set opdata, so we catch
     1367         * that and try to find the desired connection in the global list. */
     1368        if(!ic) {
     1369                GSList *l;
     1370                for(l=get_connections(); l; l=l->next) {
     1371                        ic = l->data;
     1372                        if(strcmp(accountname, ic->acc->user) == 0 &&
     1373                           strcmp(protocol, ic->acc->prpl->name) == 0)
     1374                                break;
     1375                }
     1376                assert(l != NULL);  /* a match should always be found */
     1377        }
     1378
    13721379        if (strcmp(accountname, ic->acc->user) != 0) {
    13731380                log_message(LOGLVL_WARNING,
Note: See TracChangeset for help on using the changeset viewer.