| 65 QQ_NORMAL_IM_FILE_EX_REQUEST_ACCEPT = 0x83, |
65 QQ_NORMAL_IM_FILE_EX_REQUEST_ACCEPT = 0x83, |
| 66 QQ_NORMAL_IM_FILE_EX_REQUEST_CANCEL = 0x85, |
66 QQ_NORMAL_IM_FILE_EX_REQUEST_CANCEL = 0x85, |
| 67 QQ_NORMAL_IM_FILE_EX_NOTIFY_IP = 0x87 |
67 QQ_NORMAL_IM_FILE_EX_NOTIFY_IP = 0x87 |
| 68 }; |
68 }; |
| 69 |
69 |
| 70 typedef struct _qq_im_header qq_im_header; |
70 typedef struct _qq_im_header { |
| 71 struct _qq_im_header { |
|
| 72 /* this is the common part of normal_text */ |
71 /* this is the common part of normal_text */ |
| 73 guint16 version_from; |
72 guint16 version_from; |
| 74 UID uid_from; |
73 UID uid_from; |
| 75 UID uid_to; |
74 UID uid_to; |
| 76 guint8 session_md5[QQ_KEY_LENGTH]; |
75 guint8 session_md5[QQ_KEY_LENGTH]; |
| 77 guint16 im_type; |
76 guint16 im_type; |
| 78 }; |
77 } qq_im_header; |
| 79 |
78 |
| 80 /* read the common parts of the normal_im, |
79 /* read the common parts of the normal_im, |
| 81 * returns the bytes read if succeed, or -1 if there is any error */ |
80 * returns the bytes read if succeed, or -1 if there is any error */ |
| 82 static gint get_im_header(qq_im_header *im_header, guint8 *data, gint len) |
81 static gint get_im_header(qq_im_header *im_header, guint8 *data, gint len) |
| 83 { |
82 { |
| 91 bytes += qq_getdata(im_header->session_md5, QQ_KEY_LENGTH, data + bytes); |
90 bytes += qq_getdata(im_header->session_md5, QQ_KEY_LENGTH, data + bytes); |
| 92 bytes += qq_get16(&(im_header->im_type), data + bytes); |
91 bytes += qq_get16(&(im_header->im_type), data + bytes); |
| 93 return bytes; |
92 return bytes; |
| 94 } |
93 } |
| 95 |
94 |
| 96 typedef struct _qq_emoticon qq_emoticon; |
95 typedef struct _qq_emoticon { |
| 97 struct _qq_emoticon { |
|
| 98 guint8 symbol; |
96 guint8 symbol; |
| 99 gchar *name; |
97 gchar *name; |
| 100 }; |
98 } qq_emoticon; |
| 101 |
99 |
| 102 static gboolean emoticons_is_sorted = FALSE; |
100 static gboolean emoticons_is_sorted = FALSE; |
| 103 /* Map for purple smiley convert to qq, need qsort */ |
101 /* Map for purple smiley convert to qq, need qsort */ |
| 104 static qq_emoticon emoticons_std[] = { |
102 static qq_emoticon emoticons_std[] = { |
| 105 {0x4f, "/:)"}, {0x4f, "/wx"}, {0x4f, "/small_smile"}, |
103 {0x4f, "/:)"}, {0x4f, "/wx"}, {0x4f, "/small_smile"}, |