comparison libgaim/protocols/qq/qq.c @ 14268:e6892c0050ad

[gaim-migrate @ 16950] Eliminated some debugging output and made some labels more clear for the users. Also added a few comments. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Mon, 21 Aug 2006 08:20:11 +0000
parents 584cbd1628d0
children a0394e417fab
comparison
equal deleted inserted replaced
14267:645598a4ec04 14268:e6892c0050ad
174 174
175 status = g_string_new(""); 175 status = g_string_new("");
176 176
177 switch(q_bud->status) { 177 switch(q_bud->status) {
178 case QQ_BUDDY_OFFLINE: 178 case QQ_BUDDY_OFFLINE:
179 g_string_append(status, "My Offline"); 179 g_string_append(status, "Offline");
180 break; 180 break;
181 case QQ_BUDDY_ONLINE_NORMAL: 181 case QQ_BUDDY_ONLINE_NORMAL:
182 return NULL; 182 return NULL;
183 break; 183 break;
184 /* TODO What does this status mean? Labelling it as offline... */
184 case QQ_BUDDY_ONLINE_OFFLINE: 185 case QQ_BUDDY_ONLINE_OFFLINE:
185 g_string_append(status, "Online Offline"); 186 g_string_append(status, "Offline");
186 break; 187 break;
187 case QQ_BUDDY_ONLINE_AWAY: 188 case QQ_BUDDY_ONLINE_AWAY:
188 g_string_append(status, "Away"); 189 g_string_append(status, "Away");
189 break; 190 break;
190 case QQ_BUDDY_ONLINE_INVISIBLE: 191 case QQ_BUDDY_ONLINE_INVISIBLE:
191 g_string_append(status, "Invisible"); 192 g_string_append(status, "Invisible");
192 break; 193 break;
193 default: 194 default:
194 g_string_printf(status, "Unknown-%d", q_bud->status); 195 g_string_printf(status, "Unknown-%d", q_bud->status);
195 } 196 }
196 /*
197 switch (q_bud->gender) {
198 case QQ_BUDDY_GENDER_GG:
199 g_string_append(status, " GG");
200 break;
201 case QQ_BUDDY_GENDER_MM:
202 g_string_append(status, " MM");
203 break;
204 case QQ_BUDDY_GENDER_UNKNOWN:
205 g_string_append(status, "^_*");
206 break;
207 default:
208 g_string_append(status, "^_^");
209 }
210
211 g_string_append_printf(status, " Age: %d", q_bud->age);
212 g_string_append_printf(status, " Client: %04x", q_bud->client_version);
213 having_video = q_bud->comm_flag & QQ_COMM_FLAG_VIDEO;
214 if (having_video)
215 g_string_append(status, " (video)");
216 */
217 197
218 ret = status->str; 198 ret = status->str;
219 g_string_free(status, FALSE); 199 g_string_free(status, FALSE);
220 200
221 return ret; 201 return ret;
224 204
225 /* a floating text when mouse is on the icon, show connection status here */ 205 /* a floating text when mouse is on the icon, show connection status here */
226 static void _qq_tooltip_text(GaimBuddy *b, GString *tooltip, gboolean full) 206 static void _qq_tooltip_text(GaimBuddy *b, GString *tooltip, gboolean full)
227 { 207 {
228 qq_buddy *q_bud; 208 qq_buddy *q_bud;
229 /* gchar *country, *country_utf8, *city, *city_utf8;
230 guint32 ip_value;
231 */
232 gchar *ip_str; 209 gchar *ip_str;
233 210
234 g_return_if_fail(b != NULL); 211 g_return_if_fail(b != NULL);
235 212
236 q_bud = (qq_buddy *) b->proto_data; 213 q_bud = (qq_buddy *) b->proto_data;
237 /* g_return_if_fail(q_bud != NULL); */ 214 g_return_if_fail(q_bud != NULL);
238 215
239 if (GAIM_BUDDY_IS_ONLINE(b) && q_bud != NULL) 216 if (GAIM_BUDDY_IS_ONLINE(b) && q_bud != NULL)
240 { 217 {
241 ip_str = gen_ip_str(q_bud->ip); 218 ip_str = gen_ip_str(q_bud->ip);
242 if (strlen(ip_str) != 0) { 219 if (strlen(ip_str) != 0) {
246 } 223 }
247 g_free(ip_str); 224 g_free(ip_str);
248 g_string_append_printf(tooltip, "\n<b>Age:</b> %d", q_bud->age); 225 g_string_append_printf(tooltip, "\n<b>Age:</b> %d", q_bud->age);
249 switch (q_bud->gender) { 226 switch (q_bud->gender) {
250 case QQ_BUDDY_GENDER_GG: 227 case QQ_BUDDY_GENDER_GG:
251 g_string_append(tooltip, "\n<b>Gender:</b> GG"); 228 g_string_append(tooltip, "\n<b>Gender:</b> Male");
252 break; 229 break;
253 case QQ_BUDDY_GENDER_MM: 230 case QQ_BUDDY_GENDER_MM:
254 g_string_append(tooltip, "\n<b>Gender:</b> MM"); 231 g_string_append(tooltip, "\n<b>Gender:</b> Female");
255 break; 232 break;
256 case QQ_BUDDY_GENDER_UNKNOWN: 233 case QQ_BUDDY_GENDER_UNKNOWN:
257 g_string_append(tooltip, "\n<b>Gender:</b> UNKNOWN"); 234 g_string_append(tooltip, "\n<b>Gender:</b> Unknown");
258 break; 235 break;
259 default: 236 default:
260 g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender); 237 g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender);
261 } /* switch gender */ 238 }
239 /* For debugging */
240 /*
262 g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); 241 g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1);
263 g_string_append_printf(tooltip, "\n<b>CommFlag:</b> %01x", q_bud->comm_flag); 242 g_string_append_printf(tooltip, "\n<b>CommFlag:</b> %01x", q_bud->comm_flag);
264 g_string_append_printf(tooltip, "\n<b>Client:</b> %04x", q_bud->client_version); 243 g_string_append_printf(tooltip, "\n<b>Client:</b> %04x", q_bud->client_version);
244 */
265 } 245 }
266 } 246 }
267 247
268 /* we can show tiny icons on the four corners of buddy icon, */ 248 /* we can show tiny icons on the four corners of buddy icon, */
269 static void _qq_list_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne) 249 static void _qq_list_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne)
474 } 454 }
475 g_free(face); 455 g_free(face);
476 g_free(prefix); 456 g_free(prefix);
477 } 457 }
478 458
459 /* Change your status icon (face) */
479 static void _qq_menu_change_face(GaimPluginAction *action) 460 static void _qq_menu_change_face(GaimPluginAction *action)
480 { 461 {
481 GaimConnection *gc = (GaimConnection *) action->context; 462 GaimConnection *gc = (GaimConnection *) action->context;
482 qq_data *qd = (qq_data *) gc->proto_data; 463 qq_data *qd = (qq_data *) gc->proto_data;
483 GaimRequestFields *fields; 464 GaimRequestFields *fields;
896 877
897 return m; 878 return m;
898 } 879 }
899 880
900 /* chat-related (QQ Qun) menu shown up with right-click */ 881 /* chat-related (QQ Qun) menu shown up with right-click */
901 /* XXX re-enable this 882 /* TODO re-enable this
902 static GList *_qq_chat_menu(GaimBlistNode *node) 883 static GList *_qq_chat_menu(GaimBlistNode *node)
903 { 884 {
904 GList *m; 885 GList *m;
905 GaimMenuAction *act; 886 GaimMenuAction *act;
906 887
913 894
914 return m; 895 return m;
915 } 896 }
916 */ 897 */
917 /* buddy-related menu shown up with right-click */ 898 /* buddy-related menu shown up with right-click */
918 /* XXX re-enable this 899 /* TODO re-enable this
919 static GList *_qq_buddy_menu(GaimBlistNode * node) 900 static GList *_qq_buddy_menu(GaimBlistNode * node)
920 { 901 {
921 GList *m; 902 GList *m;
922 903
923 if(GAIM_BLIST_NODE_IS_CHAT(node)) 904 if(GAIM_BLIST_NODE_IS_CHAT(node))