]> andersk Git - libfaim.git/blobdiff - include/aim.h
- Wed Sep 19 18:50:34 PDT 2001
[libfaim.git] / include / aim.h
index 2bc4c344c7fa3ac0ba7967a590173c34157e38d4..91111dd78792890f365e850dc9847523e78af6d9 100644 (file)
@@ -399,6 +399,10 @@ struct aim_userinfo_s {
 #define AIM_FLAG_AWAY          0x0020
 #define AIM_FLAG_UNKNOWN40     0x0040
 #define AIM_FLAG_UNKNOWN80     0x0080
+#define AIM_FLAG_UNKNOWN100    0x0100
+#define AIM_FLAG_UNKNOWN200    0x0200
+#define AIM_FLAG_ACTIVEBUDDY    0x0400
+#define AIM_FLAG_UNKNOWN800    0x0800
 
 #define AIM_FLAG_ALLUSERS      0x001f
 
@@ -445,9 +449,10 @@ faim_internal int aim_addtlvtochain32(aim_tlvlist_t **list, const fu16_t type, c
 faim_internal int aim_addtlvtochain_raw(aim_tlvlist_t **list, const fu16_t t, const fu16_t l, const fu8_t *v);
 faim_internal int aim_addtlvtochain_caps(aim_tlvlist_t **list, const fu16_t t, const fu16_t caps);
 faim_internal int aim_addtlvtochain_noval(aim_tlvlist_t **list, const fu16_t type);
+faim_internal int aim_addtlvtochain_userinfo(aim_tlvlist_t **list, fu16_t type, struct aim_userinfo_s *ui);
 faim_internal int aim_addtlvtochain_frozentlvlist(aim_tlvlist_t **list, fu16_t type, aim_tlvlist_t **tl);
 faim_internal int aim_counttlvchain(aim_tlvlist_t **list);
-faim_export int aim_sizetlvchain(aim_tlvlist_t **list);
+faim_internal int aim_sizetlvchain(aim_tlvlist_t **list);
 #endif /* FAIM_INTERNAL */
 
 /*
@@ -630,15 +635,50 @@ struct aim_chat_roominfo {
 #define AIM_IMFLAGS_SUBENC_MACINTOSH   0x0040 /* damn that Steve Jobs! */
 #define AIM_IMFLAGS_CUSTOMFEATURES     0x0080 /* features field present */
 #define AIM_IMFLAGS_EXTDATA            0x0100
+#define AIM_IMFLAGS_CUSTOMCHARSET      0x0200 /* charset fields set */
+#define AIM_IMFLAGS_MULTIPART          0x0400 /* ->mpmsg section valid */
 
+/*
+ * Multipart message structures.
+ */
+typedef struct aim_mpmsg_section_s {
+       fu16_t charset;
+       fu16_t charsubset;
+       fu8_t *data;
+       fu16_t datalen;
+       struct aim_mpmsg_section_s *next;
+} aim_mpmsg_section_t;
+
+typedef struct aim_mpmsg_s {
+       int numparts;
+       aim_mpmsg_section_t *parts;
+} aim_mpmsg_t;
+
+faim_export int aim_mpmsg_init(aim_session_t *sess, aim_mpmsg_t *mpm);
+faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const fu8_t *data, fu16_t datalen);
+faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii);
+faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const fu16_t *unicode, fu16_t unicodelen);
+faim_export void aim_mpmsg_free(aim_session_t *sess, aim_mpmsg_t *mpm);
+
+/*
+ * Arguments to aim_send_im_ext().
+ *
+ * This is really complicated.  But immensely versatile.
+ *
+ */
 struct aim_sendimext_args {
 
        /* These are _required_ */
        const char *destsn;
-       fu32_t flags;
+       fu32_t flags; /* often 0 */
+
+       /* Only required if not using multipart messages */
        const char *msg;
        int msglen;
 
+       /* Required if ->msg is not provided */
+       aim_mpmsg_t *mpmsg;
+
        /* Only used if AIM_IMFLAGS_HASICON is set */
        fu32_t iconlen;
        time_t iconstamp;
@@ -647,16 +687,34 @@ struct aim_sendimext_args {
        /* Only used if AIM_IMFLAGS_CUSTOMFEATURES is set */
        fu8_t *features;
        fu8_t featureslen;
+
+       /* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set and mpmsg not used */
+       fu16_t charset;
+       fu16_t charsubset;
 };
 
+/*
+ * This information is provided in the Incoming ICBM callback for
+ * Channel 1 ICBM's.  
+ *
+ * Note that although CUSTOMFEATURES and CUSTOMCHARSET say they
+ * are optional, both are always set by the current libfaim code.
+ * That may or may not change in the future.  It is mainly for
+ * consistency with aim_sendimext_args.
+ *
+ * Multipart messages require some explanation. If you want to use them,
+ * I suggest you read all the comments in im.c.
+ *
+ */
 struct aim_incomingim_ch1_args {
 
        /* Always provided */
+       aim_mpmsg_t mpmsg;
+       fu32_t icbmflags; /* some flags apply only to ->msg, not all mpmsg */
+       
+       /* Only provided if message has a human-readable section */
        char *msg;
        int msglen;
-       fu32_t icbmflags;
-       fu16_t flag1;
-       fu16_t flag2;
 
        /* Only provided if AIM_IMFLAGS_HASICON is set */
        time_t iconstamp;
@@ -670,6 +728,10 @@ struct aim_incomingim_ch1_args {
        /* Only provided if AIM_IMFLAGS_EXTDATA is set */
        fu8_t extdatalen;
        fu8_t *extdata;
+
+       /* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set */
+       fu16_t charset;
+       fu16_t charsubset;
 };
 
 struct aim_incomingim_ch2_args {
This page took 0.051772 seconds and 4 git commands to generate.