comparison libpurple/protocols/myspace/myspace.c @ 26987:cd78ea46e9bd

merge of '7c614b09b72037ebd86c03fbbeac7794a155547b' and 'af18689b86389686230fc6ce83cbba52690ce0cb'
author Paul Aurich <paul@darkrain42.org>
date Sat, 30 May 2009 00:32:50 +0000
parents ef61a2b746bd
children 1d2b813faca7
comparison
equal deleted inserted replaced
26986:42bff519973b 26987:cd78ea46e9bd
845 msim_check_inbox_cb(MsimSession *session, const MsimMessage *reply, gpointer data) 845 msim_check_inbox_cb(MsimSession *session, const MsimMessage *reply, gpointer data)
846 { 846 {
847 MsimMessage *body; 847 MsimMessage *body;
848 guint old_inbox_status; 848 guint old_inbox_status;
849 guint i, n; 849 guint i, n;
850 const gchar *froms[5], *tos[5], *urls[5], *subjects[5];
851
852 /* Information for each new inbox message type. */ 850 /* Information for each new inbox message type. */
853 static struct 851 static struct
854 { 852 {
855 const gchar *key; 853 const gchar *key;
856 guint bit; 854 guint bit;
861 { "BlogComment", MSIM_INBOX_BLOG_COMMENT, "http://blog.myspace.com/index.cfm?fuseaction=blog", NULL }, 859 { "BlogComment", MSIM_INBOX_BLOG_COMMENT, "http://blog.myspace.com/index.cfm?fuseaction=blog", NULL },
862 { "ProfileComment", MSIM_INBOX_PROFILE_COMMENT, "http://home.myspace.com/index.cfm?fuseaction=user", NULL }, 860 { "ProfileComment", MSIM_INBOX_PROFILE_COMMENT, "http://home.myspace.com/index.cfm?fuseaction=user", NULL },
863 { "FriendRequest", MSIM_INBOX_FRIEND_REQUEST, "http://messaging.myspace.com/index.cfm?fuseaction=mail.friendRequests", NULL }, 861 { "FriendRequest", MSIM_INBOX_FRIEND_REQUEST, "http://messaging.myspace.com/index.cfm?fuseaction=mail.friendRequests", NULL },
864 { "PictureComment", MSIM_INBOX_PICTURE_COMMENT, "http://home.myspace.com/index.cfm?fuseaction=user", NULL } 862 { "PictureComment", MSIM_INBOX_PICTURE_COMMENT, "http://home.myspace.com/index.cfm?fuseaction=user", NULL }
865 }; 863 };
864 const gchar *froms[G_N_ELEMENTS(message_types) + 1] = { "" },
865 *tos[G_N_ELEMENTS(message_types) + 1] = { "" },
866 *urls[G_N_ELEMENTS(message_types) + 1] = { "" },
867 *subjects[G_N_ELEMENTS(message_types) + 1] = { "" };
868
869 g_return_if_fail(reply != NULL);
866 870
867 /* Can't write _()'d strings in array initializers. Workaround. */ 871 /* Can't write _()'d strings in array initializers. Workaround. */
872 /* khc: then use N_() in the array initializer and use _() when they are
873 used */
868 message_types[0].text = _("New mail messages"); 874 message_types[0].text = _("New mail messages");
869 message_types[1].text = _("New blog comments"); 875 message_types[1].text = _("New blog comments");
870 message_types[2].text = _("New profile comments"); 876 message_types[2].text = _("New profile comments");
871 message_types[3].text = _("New friend requests!"); 877 message_types[3].text = _("New friend requests!");
872 message_types[4].text = _("New picture comments"); 878 message_types[4].text = _("New picture comments");
873 879
874 g_return_if_fail(reply != NULL);
875
876 body = msim_msg_get_dictionary(reply, "body"); 880 body = msim_msg_get_dictionary(reply, "body");
877 881
878 if (body == NULL) 882 if (body == NULL)
879 return; 883 return;
880 884
881 old_inbox_status = session->inbox_status; 885 old_inbox_status = session->inbox_status;
882 886
883 n = 0; 887 n = 0;
884 888
885 for (i = 0; i < sizeof(message_types) / sizeof(message_types[0]); ++i) { 889 for (i = 0; i < G_N_ELEMENTS(message_types); ++i) {
886 const gchar *key; 890 const gchar *key;
887 guint bit; 891 guint bit;
888 892
889 key = message_types[i].key; 893 key = message_types[i].key;
890 bit = message_types[i].bit; 894 bit = message_types[i].bit;