static int waprpl_send_im(PurpleConnection *gc, const char *who, const char *message, PurpleMessageFlags flags) {
  whatsapp_connection * wconn = purple_connection_get_protocol_data(gc);

  waAPI_sendim(wconn->waAPI,who,message);
  waprpl_check_output(gc);
  
  return 1;
}
static int waprpl_send_im(PurpleConnection * gc, const char *who, const char *message, PurpleMessageFlags flags)
{
	whatsapp_connection *wconn = purple_connection_get_protocol_data(gc);
	char *plain;

	purple_markup_html_to_xhtml(message, NULL, &plain);
	waAPI_sendim(wconn->waAPI, who, plain);
	g_free(plain);

	waprpl_check_output(gc);

	return 1;
}
Exemple #3
0
static int waprpl_send_im(PurpleConnection * gc, const char *who, const char *message, PurpleMessageFlags flags)
{
	whatsapp_connection *wconn = purple_connection_get_protocol_data(gc);
	char *plain;

	purple_markup_html_to_xhtml(message, NULL, &plain);

	char msgid[128];
	waAPI_getmsgid(wconn->waAPI, msgid);

	purple_signal_emit(purple_connection_get_prpl(gc), "whatsapp-sending-message", gc, msgid, who, message);

	waAPI_sendim(wconn->waAPI, msgid, who, plain);
	g_free(plain);

	waprpl_check_output(gc);

	return 1;
}