| 118 |
118 |
| 119 g_return_if_fail(ext_id > 0 && user_uid > 0); |
119 g_return_if_fail(ext_id > 0 && user_uid > 0); |
| 120 |
120 |
| 121 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
121 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
| 122 |
122 |
| 123 msg = g_strdup_printf(_("%d requested to join Qun %d"), user_uid, ext_id); |
123 msg = g_strdup_printf(_("%d request to join Qun %d"), user_uid, ext_id); |
| 124 reason = g_strdup_printf(_("Message: %s"), reason_utf8); |
124 reason = g_strdup_printf(_("Message: %s"), reason_utf8); |
| 125 |
125 |
| 126 g = g_new0(group_member_opt, 1); |
126 g = g_new0(group_member_opt, 1); |
| 127 g->gc = gc; |
127 g->gc = gc; |
| 128 g->id = id; |
128 g->id = id; |
| 169 g_return_if_fail(ext_id > 0 && admin_uid > 0); |
169 g_return_if_fail(ext_id > 0 && admin_uid > 0); |
| 170 |
170 |
| 171 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
171 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
| 172 |
172 |
| 173 msg = g_strdup_printf |
173 msg = g_strdup_printf |
| 174 (_("Your request to join Qun %d has been rejected by admin %d"), ext_id, admin_uid); |
174 (_("Failed to join Qun %d, operated by admin %d"), ext_id, admin_uid); |
| 175 reason = g_strdup_printf(_("Message: %s"), reason_utf8); |
175 reason = g_strdup_printf(_("Message: %s"), reason_utf8); |
| 176 |
176 |
| 177 purple_notify_warning(gc, _("QQ Qun Operation"), msg, reason); |
177 purple_notify_warning(gc, _("QQ Qun Operation"), msg, reason); |
| 178 |
178 |
| 179 group = qq_room_search_id(gc, id); |
179 group = qq_room_search_id(gc, id); |
| 207 g_return_if_fail(ext_id > 0 && admin_uid > 0); |
207 g_return_if_fail(ext_id > 0 && admin_uid > 0); |
| 208 /* it is also a "无" here, so do not display */ |
208 /* it is also a "无" here, so do not display */ |
| 209 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
209 bytes += convert_as_pascal_string(data + bytes, &reason_utf8, QQ_CHARSET_DEFAULT); |
| 210 |
210 |
| 211 msg = g_strdup_printf |
211 msg = g_strdup_printf |
| 212 (_("Your request to join Qun %d has been approved by admin %d"), ext_id, admin_uid); |
212 (_("Successed to join Qun %d, operated by admin %d"), ext_id, admin_uid); |
| 213 |
213 |
| 214 purple_notify_warning(gc, _("QQ Qun Operation"), msg, NULL); |
214 purple_notify_warning(gc, _("QQ Qun Operation"), msg, NULL); |
| 215 |
215 |
| 216 group = qq_room_search_id(gc, id); |
216 group = qq_room_search_id(gc, id); |
| 217 if (group != NULL) { |
217 if (group != NULL) { |
| 282 qq_group_refresh(gc, group); |
282 qq_group_refresh(gc, group); |
| 283 } else { /* no such group, try to create a dummy first, and then update */ |
283 } else { /* no such group, try to create a dummy first, and then update */ |
| 284 group = qq_group_create_internal_record(gc, id, ext_id, NULL); |
284 group = qq_group_create_internal_record(gc, id, ext_id, NULL); |
| 285 group->my_role = QQ_ROOM_ROLE_YES; |
285 group->my_role = QQ_ROOM_ROLE_YES; |
| 286 qq_group_refresh(gc, group); |
286 qq_group_refresh(gc, group); |
| 287 qq_room_update(gc, 0, group->id); |
287 qq_update_room(gc, 0, group->id); |
| 288 /* the return of this cmd will automatically update the group in blist */ |
288 /* the return of this cmd will automatically update the group in blist */ |
| 289 } |
289 } |
| 290 |
290 |
| 291 g_free(msg); |
291 g_free(msg); |
| 292 } |
292 } |
| 378 g_return_if_fail(group != NULL); |
378 g_return_if_fail(group != NULL); |
| 379 |
379 |
| 380 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, group->title_utf8, purple_connection_get_account(gc)); |
380 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, group->title_utf8, purple_connection_get_account(gc)); |
| 381 if (conv == NULL && purple_prefs_get_bool("/plugins/prpl/qq/prompt_group_msg_on_recv")) { |
381 if (conv == NULL && purple_prefs_get_bool("/plugins/prpl/qq/prompt_group_msg_on_recv")) { |
| 382 /* New conv should open, get group info*/ |
382 /* New conv should open, get group info*/ |
| 383 qq_room_update(gc, 0, group->id); |
383 /* qq_update_room(gc, 0, group->id); */ |
| |
384 qq_send_room_cmd_only(gc, QQ_ROOM_CMD_GET_ONLINES, group->id); |
| 384 |
385 |
| 385 serv_got_joined_chat(gc, qd->channel++, group->title_utf8); |
386 serv_got_joined_chat(gc, qd->channel++, group->title_utf8); |
| 386 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, group->title_utf8, purple_connection_get_account(gc)); |
387 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, group->title_utf8, purple_connection_get_account(gc)); |
| 387 } |
388 } |
| 388 |
389 |