libpurple/protocols/novell/novell.c

changeset 36077
b7328f4317c7
parent 36076
a0e5b68ff4ef
child 36078
ad2b7d9cc0c3
equal deleted inserted replaced
36076:a0e5b68ff4ef 36077:b7328f4317c7
2482 } 2482 }
2483 } 2483 }
2484 } 2484 }
2485 2485
2486 static int 2486 static int
2487 novell_chat_send(PurpleConnection * gc, int id, const char *text, PurpleMessageFlags flags) 2487 novell_chat_send(PurpleConnection * gc, int id, PurpleMessage *msg)
2488 { 2488 {
2489 NMConference *conference; 2489 NMConference *conference;
2490 PurpleChatConversation *chat; 2490 PurpleChatConversation *chat;
2491 GSList *cnode; 2491 GSList *cnode;
2492 NMMessage *message; 2492 NMMessage *message;
2493 NMUser *user; 2493 NMUser *user;
2494 NMERR_T rc = NM_OK; 2494 NMERR_T rc = NM_OK;
2495 const char *name; 2495 const char *name;
2496 char *str, *plain; 2496 char *str, *plain;
2497 2497
2498 if (gc == NULL || text == NULL) 2498 if (gc == NULL || purple_message_is_empty(msg))
2499 return -1; 2499 return -1;
2500 2500
2501 user = purple_connection_get_protocol_data(gc); 2501 user = purple_connection_get_protocol_data(gc);
2502 if (user == NULL) 2502 if (user == NULL)
2503 return -1; 2503 return -1;
2504 2504
2505 plain = purple_unescape_html(text); 2505 plain = purple_unescape_html(purple_message_get_contents(msg));
2506 message = nm_create_message(plain); 2506 message = nm_create_message(plain);
2507 g_free(plain); 2507 g_free(plain);
2508 2508
2509 for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) { 2509 for (cnode = user->conferences; cnode != NULL; cnode = cnode->next) {
2510 conference = cnode->data; 2510 conference = cnode->data;
2536 /* Fall back to the username that we are signed in with */ 2536 /* Fall back to the username that we are signed in with */
2537 name = purple_account_get_username(user->client_data); 2537 name = purple_account_get_username(user->client_data);
2538 } 2538 }
2539 } 2539 }
2540 2540
2541 purple_serv_got_chat_in(gc, id, name, flags, text, time(NULL)); 2541 purple_serv_got_chat_in(gc, id, name,
2542 purple_message_get_flags(msg),
2543 purple_message_get_contents(msg), time(NULL));
2542 return 0; 2544 return 0;
2543 } else 2545 } else
2544 return -1; 2546 return -1;
2545 2547
2546 } 2548 }

mercurial