comparison libgaim/protocols/qq/buddy_info.h @ 14611:000b8c063121

[gaim-migrate @ 17339] My previous implementation was a bit awkward. This requires less overhead. Also, let's only show those info fields that a buddy has actually filled out. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Fri, 22 Sep 2006 17:03:54 +0000
parents 60b1bc8dbf37
children c039c920e11c
comparison
equal deleted inserted replaced
14610:473b225e7352 14611:000b8c063121
23 #ifndef _QQ_BUDDY_INFO_H_ 23 #ifndef _QQ_BUDDY_INFO_H_
24 #define _QQ_BUDDY_INFO_H_ 24 #define _QQ_BUDDY_INFO_H_
25 25
26 #include <glib.h> 26 #include <glib.h>
27 #include "connection.h" 27 #include "connection.h"
28
28 #include "buddy_opt.h" 29 #include "buddy_opt.h"
29 #include "qq.h" 30 #include "qq.h"
30 31
31 #define QQ_COMM_FLAG_QQ_MEMBER 0x02 32 #define QQ_COMM_FLAG_QQ_MEMBER 0x02
32 #define QQ_COMM_FLAG_TCP_MODE 0x10 33 #define QQ_COMM_FLAG_TCP_MODE 0x10
37 #define QQ_BUDDY_GENDER_GG 0x00 38 #define QQ_BUDDY_GENDER_GG 0x00
38 #define QQ_BUDDY_GENDER_MM 0x01 39 #define QQ_BUDDY_GENDER_MM 0x01
39 #define QQ_BUDDY_GENDER_UNKNOWN 0xff 40 #define QQ_BUDDY_GENDER_UNKNOWN 0xff
40 41
41 typedef struct _contact_info { 42 typedef struct _contact_info {
42 gchar *uid; 43 gchar *uid;
43 gchar *nick; 44 gchar *nick;
44 gchar *country; 45 gchar *country;
45 gchar *province; 46 gchar *province;
46 gchar *zipcode; 47 gchar *zipcode;
47 gchar *address; 48 gchar *address;
48 gchar *tel; 49 gchar *tel;
49 gchar *age; 50 gchar *age;
50 gchar *gender; 51 gchar *gender;
51 gchar *name; 52 gchar *name;
52 gchar *email; 53 gchar *email;
53 gchar *pager_sn; 54 gchar *pager_sn;
54 gchar *pager_num; 55 gchar *pager_num;
55 gchar *pager_sp; 56 gchar *pager_sp;
56 gchar *pager_base_num; 57 gchar *pager_base_num;
57 gchar *pager_type; 58 gchar *pager_type;
58 gchar *occupation; 59 gchar *occupation;
59 gchar *homepage; 60 gchar *homepage;
60 gchar *auth_type; 61 gchar *auth_type;
61 gchar *unknown1; 62 gchar *unknown1;
62 gchar *unknown2; 63 gchar *unknown2;
63 gchar *face; 64 gchar *face;
64 gchar *hp_num; 65 gchar *hp_num;
65 gchar *hp_type; 66 gchar *hp_type;
66 gchar *intro; 67 gchar *intro;
67 gchar *city; 68 gchar *city;
68 gchar *unknown3; 69 gchar *unknown3;
69 gchar *unknown4; 70 gchar *unknown4;
70 gchar *unknown5; 71 gchar *unknown5;
71 gchar *is_open_hp; 72 gchar *is_open_hp;
72 gchar *is_open_contact; 73 gchar *is_open_contact;
73 gchar *college; 74 gchar *college;
74 gchar *horoscope; 75 gchar *horoscope;
75 gchar *zodiac; 76 gchar *zodiac;
76 gchar *blood; 77 gchar *blood;
77 gchar *qq_show; 78 gchar *qq_show;
78 gchar *unknown6; /* always 0x2D */ 79 gchar *unknown6; /* always 0x2D */
79 } contact_info; 80 } contact_info;
80
81 /* There is no user id stored in the reply packet for information query
82 * we have to manually store the query, so that we know the query source */
83 typedef struct _qq_info_query {
84 guint32 uid;
85 gboolean show_window;
86 gboolean modify_info;
87 } qq_info_query;
88
89 /* We get an info packet on ourselves before we modify our information.
90 * Even though not all of the information is currently modifiable, it still
91 * all needs to be there when we send out the modify info packet */
92 typedef struct _modify_info_data {
93 GaimConnection *gc;
94 GList *misc, *node;
95 } modify_info_data;
96
97 #define QQ_CONTACT_FIELDS 37
98
99 #define QQ_MAIN_INFO "Primary Information"
100 #define QQ_EXTRA_INFO "Detailed Information"
101 #define QQ_PERSONAL_INTRO "Personal Introduction"
102 #define QQ_MISC "Miscellaneous"
103
104 #define QQ_NO_CHOICE 0
105 #define QQ_HOROSCOPE 1
106 #define QQ_ZODIAC 2
107 #define QQ_BLOOD 3
108 #define QQ_GENDER 4
109 #define QQ_COUNTRY 5
110 #define QQ_PROVINCE 6
111 #define QQ_OCCUPATION 7
112 81
113 void qq_refresh_buddy_and_myself(contact_info *info, GaimConnection *gc); 82 void qq_refresh_buddy_and_myself(contact_info *info, GaimConnection *gc);
114 void qq_send_packet_get_info(GaimConnection *gc, guint32 uid, gboolean show_window); 83 void qq_send_packet_get_info(GaimConnection *gc, guint32 uid, gboolean show_window);
115 void qq_send_packet_modify_info(GaimConnection *gc, contact_info *info);
116 void qq_prepare_modify_info(GaimConnection *gc); 84 void qq_prepare_modify_info(GaimConnection *gc);
117 void qq_process_modify_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); 85 void qq_process_modify_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc);
118 void qq_process_get_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); 86 void qq_process_get_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc);
119 void qq_info_query_free(qq_data *qd); 87 void qq_info_query_free(qq_data *qd);
120 88