cpw.qulogic.msn: 1b1179b7: Make errors when sending OIM's more visi...
qulogic at pidgin.im
qulogic at pidgin.im
Sat Jun 21 04:00:56 EDT 2008
-----------------------------------------------------------------
Revision: 1b1179b7e283ed88d5df086b802b8d59eb2d65cd
Ancestor: 97c85653d5e31d6a1a59bdbe7d96b57be7d19af7
Author: qulogic at pidgin.im
Date: 2008-06-20T05:36:18
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/1b1179b7e283ed88d5df086b802b8d59eb2d65cd
Modified files:
libpurple/protocols/msn/oim.c
libpurple/protocols/msn/session.c
libpurple/protocols/msn/session.h
ChangeLog:
Make errors when sending OIM's more visible.
Also, msn_session_report_user doesn't modify msg, so it can be const.
References #5379.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/oim.c 74e29f789e57694ae8bda13438fefd2d500e15d1
+++ libpurple/protocols/msn/oim.c 0b6b36e04f06d21a150067252c9a88d48a91011c
@@ -333,6 +333,32 @@ msn_oim_send_read_cb(MsnSoapMessage *req
g_queue_push_head(oim->send_queue, msg);
msn_oim_send_msg(oim);
}
+ } else {
+ /* Report the error */
+ const char *str_reason;
+
+ if (g_str_equal(faultcode_str, "q0:SystemUnavailable")) {
+ str_reason = _("Message was not sent because the system is "
+ "unavailable. This normally happens when the "
+ "user is blocked or does not exist.");
+
+ } else if (g_str_equal(faultcode_str, "q0:SenderThrottleLimitExceeded")) {
+ str_reason = _("Message was not sent because messages "
+ "are being sent too quickly.");
+
+ } else if (g_str_equal(faultcode_str, "q0:InvalidContent")) {
+ str_reason = _("Message was not sent because an unknown "
+ "encoding error occured.");
+
+ } else {
+ str_reason = _("Message was not sent because an unknown "
+ "error occured.");
+ }
+
+ msn_session_report_user(oim->session, msg->to_member,
+ str_reason, PURPLE_MESSAGE_ERROR);
+ msn_session_report_user(oim->session, msg->to_member,
+ msg->oim_msg, PURPLE_MESSAGE_RAW);
}
g_free(faultcode_str);
============================================================
--- libpurple/protocols/msn/session.c 10c3fed6ef04dcee45980dffe6a2368e4ea1c1d4
+++ libpurple/protocols/msn/session.c d6be2d414b5426ce33305b5c5ba4af58bb8cee39
@@ -192,7 +192,7 @@ void
* passport - the one want to talk to you
*/
void
-msn_session_report_user(MsnSession *session,const char *passport,char *msg,PurpleMessageFlags flags)
+msn_session_report_user(MsnSession *session,const char *passport,const char *msg,PurpleMessageFlags flags)
{
PurpleConversation * conv;
============================================================
--- libpurple/protocols/msn/session.h 4d3267f1a7f69fc6bbde267857c35df84daa981e
+++ libpurple/protocols/msn/session.h f2e6c96f9ed27494d0b6ce5fec2567e30b8f0098
@@ -232,6 +232,6 @@ void msn_session_report_user(MsnSession
/*post message to User*/
void msn_session_report_user(MsnSession *session,const char *passport,
- char *msg,PurpleMessageFlags flags);
+ const char *msg,PurpleMessageFlags flags);
#endif /* _MSN_SESSION_H_ */
More information about the Commits
mailing list