| 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; |
| 253 gchar *content, *content_utf8; |
254 gchar *content, *content_utf8; |
| 254 |
255 |
| 255 g_return_if_fail(data != NULL && data_len != 0); |
256 g_return_if_fail(data != NULL && data_len != 0); |
| 256 |
257 |
| 257 #if 0 |
258 #if 0 |
| 274 bytes += qq_get8(&temp_len, data + bytes); |
275 bytes += qq_get8(&temp_len, data + bytes); |
| 275 g_return_if_fail(bytes + temp_len <= data_len); |
276 g_return_if_fail(bytes + temp_len <= data_len); |
| 276 bytes += qq_getdata(temp, temp_len, data+bytes); |
277 bytes += qq_getdata(temp, temp_len, data+bytes); |
| 277 url = g_strndup((gchar *)temp, temp_len); |
278 url = g_strndup((gchar *)temp, temp_len); |
| 278 |
279 |
| 279 content = g_strdup_printf(_("Title: %s\nBrief: %s\n\n%s"), title, brief, url); |
280 title_utf8 = qq_to_utf8(title, QQ_CHARSET_DEFAULT); |
| |
281 content = g_strdup_printf(_("%s\n\n%s"), brief, url); |
| 280 content_utf8 = qq_to_utf8(content, QQ_CHARSET_DEFAULT); |
282 content_utf8 = qq_to_utf8(content, QQ_CHARSET_DEFAULT); |
| 281 |
283 |
| 282 if (qd->is_show_news) { |
284 if (qd->is_show_news) { |
| 283 purple_notify_info(gc, NULL, _("QQ Server News"), content_utf8); |
285 purple_notify_info(gc, _("QQ Server News"), title_utf8, content_utf8); |
| 284 } else { |
286 } else { |
| 285 purple_debug_info("QQ", "QQ Server news:\n%s", content_utf8); |
287 purple_debug_info("QQ", "QQ Server news:\n%s\n%s", title_utf8, content_utf8); |
| 286 } |
288 } |
| 287 g_free(title); |
289 g_free(title); |
| |
290 g_free(title_utf8); |
| 288 g_free(brief); |
291 g_free(brief); |
| 289 g_free(url); |
292 g_free(url); |
| 290 g_free(content); |
293 g_free(content); |
| 291 g_free(content_utf8); |
294 g_free(content_utf8); |
| 292 } |
295 } |