comparison libpurple/protocols/qq/im.h @ 24601:fecedf6d9ee1

propagate from branch 'im.pidgin.pidgin' (head 97d295a04f3a9852a3b29cf0df43d56d1ddcc672) to branch 'im.pidgin.pidgin.openq' (head a0d99396d1603b53838d74cad4391ece34f3ebbf)
author SHiNE CsyFeK <csyfek@gmail.com>
date Fri, 05 Dec 2008 14:51:36 +0000
parents d2d6fff831dc
children d8452c0bec7b
comparison
equal deleted inserted replaced
24536:c457c635eb8f 24601:fecedf6d9ee1
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_QUN_IM_UNKNOWN = 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,
49 QQ_MSG_APPROVE_APPLY_ADD_TO_QUN = 0x0024, 40 QQ_MSG_APPROVE_APPLY_ADD_TO_QUN = 0x0024,
50 QQ_MSG_REJCT_APPLY_ADD_TO_QUN = 0x0025, 41 QQ_MSG_REJCT_APPLY_ADD_TO_QUN = 0x0025,
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 guint8 attr;
53 guint8 rgb[3];
54 guint16 charset;
55 gchar *font; /* Attension: font may NULL. font name is in QQ charset */
56 guint8 font_len;
57 } qq_im_format;
61 58
62 guint8 *qq_get_send_im_tail(const gchar *font_color, 59 gint qq_put_im_tail(guint8 *buf, qq_im_format *fmt);
63 const gchar *font_size, 60 gint qq_get_im_tail(qq_im_format *fmt, guint8 *data, gint data_len);
64 const gchar *font_name,
65 gboolean is_bold, gboolean is_italic, gboolean is_underline, gint len);
66 61
67 void qq_request_send_im(PurpleConnection *gc, guint32 uid_to, gchar *msg, gint type); 62 qq_im_format *qq_im_fmt_new(void);
63 void qq_im_fmt_free(qq_im_format *fmt);
64 qq_im_format *qq_im_fmt_new_by_purple(const gchar *msg);
65 gchar *qq_im_fmt_to_purple(qq_im_format *fmt, gchar *text);
66 gboolean qq_im_smiley_none(const gchar *msg);
67 GSList *qq_im_get_segments(gchar *msg_stripped, gboolean is_smiley_none);
68
69 void qq_got_message(PurpleConnection *gc, const gchar *msg);
70 gint qq_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, PurpleMessageFlags flags);
68 71
69 void qq_process_im(PurpleConnection *gc, guint8 *data, gint len); 72 void qq_process_im(PurpleConnection *gc, guint8 *data, gint len);
70 void qq_process_extend_im(PurpleConnection *gc, guint8 *data, gint len); 73 void qq_process_extend_im(PurpleConnection *gc, guint8 *data, gint len);
74
75 gchar *qq_emoticon_to_purple(gchar *text);
71 #endif 76 #endif