Mercurial > pidgin.yaz
comparison libpurple/prpl.c @ 32767:2ec94166be43
On the way to hiding the PurpleConnection struct.
* Added purple_connection_get_flags() and purple_connection_set_flags()
* Use purple_connection_ accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 18 Oct 2011 18:47:48 +0000 |
parents | 5aa171c8776b |
children |
comparison
equal
deleted
inserted
replaced
32766:ea2b621fd3ba | 32767:2ec94166be43 |
---|---|
444 time_t mtime; | 444 time_t mtime; |
445 | 445 |
446 g_return_if_fail(gc != NULL); | 446 g_return_if_fail(gc != NULL); |
447 g_return_if_fail(who != NULL); | 447 g_return_if_fail(who != NULL); |
448 | 448 |
449 prpl = purple_find_prpl(purple_account_get_protocol_id(gc->account)); | 449 prpl = purple_find_prpl(purple_account_get_protocol_id(purple_connection_get_account(gc))); |
450 send_attention = PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention; | 450 send_attention = PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention; |
451 g_return_if_fail(send_attention != NULL); | 451 g_return_if_fail(send_attention != NULL); |
452 | 452 |
453 mtime = time(NULL); | 453 mtime = time(NULL); |
454 | 454 |
455 attn = purple_get_attention_type_from_code(gc->account, type_code); | 455 attn = purple_get_attention_type_from_code(purple_connection_get_account(gc), type_code); |
456 | 456 |
457 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL) | 457 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL) |
458 alias = purple_buddy_get_contact_alias(buddy); | 458 alias = purple_buddy_get_contact_alias(buddy); |
459 else | 459 else |
460 alias = who; | 460 alias = who; |
471 description, who); | 471 description, who); |
472 | 472 |
473 if (!send_attention(gc, who, type_code)) | 473 if (!send_attention(gc, who, type_code)) |
474 return; | 474 return; |
475 | 475 |
476 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, gc->account, who); | 476 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, purple_connection_get_account(gc), who); |
477 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, description, flags, mtime); | 477 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, description, flags, mtime); |
478 purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_SEND, time(NULL)); | 478 purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_SEND, time(NULL)); |
479 | 479 |
480 g_free(description); | 480 g_free(description); |
481 } | 481 } |
490 gchar *description; | 490 gchar *description; |
491 time_t mtime; | 491 time_t mtime; |
492 | 492 |
493 mtime = time(NULL); | 493 mtime = time(NULL); |
494 | 494 |
495 attn = purple_get_attention_type_from_code(gc->account, type_code); | 495 attn = purple_get_attention_type_from_code(purple_connection_get_account(gc), type_code); |
496 | 496 |
497 /* PURPLE_MESSAGE_NOTIFY is for attention messages. */ | 497 /* PURPLE_MESSAGE_NOTIFY is for attention messages. */ |
498 flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_RECV; | 498 flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_RECV; |
499 | 499 |
500 /* TODO: if (attn->icon_name) is non-null, use it to lookup an emoticon and display | 500 /* TODO: if (attn->icon_name) is non-null, use it to lookup an emoticon and display |