static void msn_switchboard_report_user(MsnSwitchBoard *swboard, GaimMessageFlags flags, const char *msg) { GaimConversation *conv; g_return_if_fail(swboard != NULL); g_return_if_fail(msg != NULL); if ((conv = msn_switchboard_get_conv(swboard)) != NULL) { gaim_conversation_write(conv, NULL, msg, flags, time(NULL)); } }
/** * Free any ODC related data and print a message to the conversation * window based on conn->disconnect_reason. */ void peer_odc_close(PeerConnection *conn) { gchar *tmp; if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) tmp = g_strdup(_("The remote user has closed the connection.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_REFUSED) tmp = g_strdup(_("The remote user has declined your request.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_LOST_CONNECTION) tmp = g_strdup_printf(_("Lost connection with the remote user:<br>%s"), conn->error_message); else if (conn->disconnect_reason == OSCAR_DISCONNECT_INVALID_DATA) tmp = g_strdup(_("Received invalid data on connection with remote user.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_COULD_NOT_CONNECT) tmp = g_strdup(_("Could not establish a connection with the remote user.")); else /* * We shouldn't print a message for some disconnect_reasons. * Like OSCAR_DISCONNECT_LOCAL_CLOSED. */ tmp = NULL; if (tmp != NULL) { GaimAccount *account; GaimConversation *conv; account = gaim_connection_get_account(conn->od->gc); conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, conn->sn); gaim_conversation_write(conv, NULL, tmp, GAIM_MESSAGE_SYSTEM, time(NULL)); g_free(tmp); } if (conn->frame != NULL) { OdcFrame *frame; frame = conn->frame; g_free(frame->payload.data); g_free(frame); } }
void GaimChatMngr::WriteIMCbk(GaimConversation *conv, const char *who, const char *message, GaimMessageFlags flags, time_t mtime) { gaim_conversation_write(conv, who, message, flags, mtime); }