libpurple/protocols/qq/im.c

changeset 24309
8d52952c9c55
parent 24302
0130b3e3ba4c
child 24312
9b07d084baff
equal deleted inserted replaced
24302:0130b3e3ba4c 24309:8d52952c9c55
248 qq_data *qd = (qq_data *) gc->proto_data; 248 qq_data *qd = (qq_data *) gc->proto_data;
249 gint bytes; 249 gint bytes;
250 guint8 *temp; 250 guint8 *temp;
251 guint8 temp_len; 251 guint8 temp_len;
252 gchar *title, *brief, *url; 252 gchar *title, *brief, *url;
253 gchar *title_utf8;
254 gchar *content, *content_utf8; 253 gchar *content, *content_utf8;
255 254
256 g_return_if_fail(data != NULL && data_len != 0); 255 g_return_if_fail(data != NULL && data_len != 0);
257 256
258 #if 0 257 #if 0
275 bytes += qq_get8(&temp_len, data + bytes); 274 bytes += qq_get8(&temp_len, data + bytes);
276 g_return_if_fail(bytes + temp_len <= data_len); 275 g_return_if_fail(bytes + temp_len <= data_len);
277 bytes += qq_getdata(temp, temp_len, data+bytes); 276 bytes += qq_getdata(temp, temp_len, data+bytes);
278 url = g_strndup((gchar *)temp, temp_len); 277 url = g_strndup((gchar *)temp, temp_len);
279 278
280 title_utf8 = qq_to_utf8(title, QQ_CHARSET_DEFAULT); 279 content = g_strdup_printf(_("Title: %s\nBrief: %s\n\n%s"), title, brief, url);
281 content = g_strdup_printf(_("%s\n\n%s"), brief, url);
282 content_utf8 = qq_to_utf8(content, QQ_CHARSET_DEFAULT); 280 content_utf8 = qq_to_utf8(content, QQ_CHARSET_DEFAULT);
283 281
284 if (qd->is_show_news) { 282 if (qd->is_show_news) {
285 purple_notify_info(gc, _("QQ Server News"), title_utf8, content_utf8); 283 purple_notify_info(gc, NULL, _("QQ Server News"), content_utf8);
286 } else { 284 } else {
287 purple_debug_info("QQ", "QQ Server news:\n%s\n%s", title_utf8, content_utf8); 285 purple_debug_info("QQ", "QQ Server news:\n%s", content_utf8);
288 } 286 }
289 g_free(title); 287 g_free(title);
290 g_free(title_utf8);
291 g_free(brief); 288 g_free(brief);
292 g_free(url); 289 g_free(url);
293 g_free(content); 290 g_free(content);
294 g_free(content_utf8); 291 g_free(content_utf8);
295 } 292 }

mercurial