Exemplo n.º 1
0
URLTranslation *urltrans_find(URLTranslationList *trans, Msg *msg) 
{
    URLTranslation *t = NULL;
    
    t = find_translation(trans, msg);
    if (t == NULL) {
        t = find_default_translation(trans, msg->sms.smsc_id, msg->sms.sender, msg->sms.receiver, msg->sms.account);
    }

    return t;
}
Exemplo n.º 2
0
URLTranslation *urltrans_find(URLTranslationList *trans, Octstr *text,
			      Octstr *smsc, Octstr *sender, Octstr *receiver) 
{
    List *words;
    URLTranslation *t = NULL;
    int reject = 0;
    
    /* do not panic if text == NULL */
    if (text != NULL) {
        words = octstr_split_words(text);
        t = find_translation(trans, words, smsc, sender, receiver, &reject);
        list_destroy(words, octstr_destroy_item);
    }
    
    if (reject)
	t = find_black_list_translation(trans, smsc);
    if (t == NULL) {
	t = find_default_translation(trans, smsc, sender, receiver, &reject);
	if (reject)
	    t = find_black_list_translation(trans, smsc);
    }
    return t;
}