comparison libpurple/protocols/qq/im.h @ 24567:7aecbc973329

Rewrite according to im.c
author Hu Yong <ccpaging@gmail.com>
date Tue, 11 Nov 2008 07:17:11 +0000
parents ce94189f15ad
children d2d6fff831dc
comparison
equal deleted inserted replaced
24566:682eb95a6aa7 24567:7aecbc973329
25 #ifndef _QQ_IM_H_ 25 #ifndef _QQ_IM_H_
26 #define _QQ_IM_H_ 26 #define _QQ_IM_H_
27 27
28 #include <glib.h> 28 #include <glib.h>
29 #include "connection.h" 29 #include "connection.h"
30 #include "group.h"
31
32 #define QQ_MSG_IM_MAX 500 /* max length of IM */
33 #define QQ_SEND_IM_BEFORE_MSG_LEN 53
34 #define QQ_SEND_IM_AFTER_MSG_LEN 13 /* there is one 0x00 at the end */
35
36 enum {
37 QQ_IM_TEXT = 0x01,
38 QQ_IM_AUTO_REPLY = 0x02
39 };
40 30
41 enum { 31 enum {
42 QQ_MSG_TO_BUDDY = 0x0009, 32 QQ_MSG_TO_BUDDY = 0x0009,
43 QQ_MSG_TO_UNKNOWN = 0x000a, 33 QQ_MSG_TO_UNKNOWN = 0x000a,
34 QQ_MSG_SMS = 0x0014, /* not sure */
44 QQ_MSG_NEWS = 0x0018, 35 QQ_MSG_NEWS = 0x0018,
45 QQ_MSG_UNKNOWN_QUN_IM = 0x0020, 36 QQ_MSG_UNKNOWN_QUN_IM = 0x0020,
46 QQ_MSG_ADD_TO_QUN = 0x0021, 37 QQ_MSG_ADD_TO_QUN = 0x0021,
47 QQ_MSG_DEL_FROM_QUN = 0x0022, 38 QQ_MSG_DEL_FROM_QUN = 0x0022,
48 QQ_MSG_APPLY_ADD_TO_QUN = 0x0023, 39 QQ_MSG_APPLY_ADD_TO_QUN = 0x0023,
55 QQ_MSG_SYS_4C = 0x004C, 46 QQ_MSG_SYS_4C = 0x004C,
56 QQ_MSG_EXTEND = 0x0084, 47 QQ_MSG_EXTEND = 0x0084,
57 QQ_MSG_EXTEND_85 = 0x0085, 48 QQ_MSG_EXTEND_85 = 0x0085,
58 }; 49 };
59 50
60 void qq_got_attention(PurpleConnection *gc, const gchar *msg); 51 typedef struct {
52 gchar *font; /* Attension: font may NULL. font name is in QQ charset */
53 guint8 font_len;
54 guint8 attr;
55 guint8 rgb[3];
56 } qq_im_format;
61 57
62 guint8 *qq_get_send_im_tail(const gchar *font_color, 58 qq_im_format *qq_im_fmt_new_by_purple(const gchar *msg);
63 const gchar *font_size, 59 gboolean qq_im_smiley_none(const gchar *msg);
64 const gchar *font_name, 60 void qq_im_fmt_free(qq_im_format *fmt);
65 gboolean is_bold, gboolean is_italic, gboolean is_underline, gint len); 61 GSList *qq_im_get_segments(gchar *msg_stripped, gboolean is_smiley_none);
62 gint qq_put_im_tail(guint8 *buf, qq_im_format *fmt);
66 63
67 void qq_request_send_im(PurpleConnection *gc, guint32 uid_to, gchar *msg, gint type); 64 void qq_got_message(PurpleConnection *gc, const gchar *msg);
65 gint qq_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, PurpleMessageFlags flags);
68 66
69 void qq_process_im(PurpleConnection *gc, guint8 *data, gint len); 67 void qq_process_im(PurpleConnection *gc, guint8 *data, gint len);
70 void qq_process_extend_im(PurpleConnection *gc, guint8 *data, gint len); 68 void qq_process_extend_im(PurpleConnection *gc, guint8 *data, gint len);
69
70 gchar *qq_emoticon_to_purple(gchar *text);
71 gchar *qq_format_to_purple(guint8 *data, gint len, gchar *text);
71 #endif 72 #endif