| 377 end++; |
377 end++; |
| 378 |
378 |
| 379 if ( end == mx->msg->len ) /* end of emoticon tag not found */ |
379 if ( end == mx->msg->len ) /* end of emoticon tag not found */ |
| 380 break; |
380 break; |
| 381 |
381 |
| 382 memset( ii, 0x00, sizeof( ii ) ); |
382 ii = g_strndup(&mx->msg->str[emo_ofs], end - emo_ofs); |
| 383 memcpy( ii, &mx->msg->str[emo_ofs], end - emo_ofs ); |
|
| 384 |
383 |
| 385 /* remove inline image tag */ |
384 /* remove inline image tag */ |
| 386 g_string_erase( mx->msg, start, ( end - start ) + 1 ); |
385 g_string_erase( mx->msg, start, ( end - start ) + 1 ); |
| 387 |
386 |
| 388 /* find the image entry */ |
387 /* find the image entry */ |
| 394 else { |
393 else { |
| 395 /* insert img tag */ |
394 /* insert img tag */ |
| 396 g_snprintf( tag, sizeof( tag ), "<img id=\"%i\">", *img_id ); |
395 g_snprintf( tag, sizeof( tag ), "<img id=\"%i\">", *img_id ); |
| 397 g_string_insert( mx->msg, start, tag ); |
396 g_string_insert( mx->msg, start, tag ); |
| 398 } |
397 } |
| |
398 |
| |
399 g_free(ii); |
| 399 } |
400 } |
| 400 } |
401 } |
| 401 |
402 |
| 402 #ifdef MXIT_DEBUG_MARKUP |
403 #ifdef MXIT_DEBUG_MARKUP |
| 403 purple_debug_info( MXIT_PLUGIN_ID, "Markup RX (converted): '%s'\n", mx->msg->str ); |
404 purple_debug_info( MXIT_PLUGIN_ID, "Markup RX (converted): '%s'\n", mx->msg->str ); |