Mercurial > pidgin.yaz
comparison src/conversation.h @ 6982:083d1e4a9c78
[gaim-migrate @ 7538]
This is Mr. Holland's Opus. And by Mr. Holland I mean Robot101. He
rewrote the coreish IM image support so that the binary data gets
ripped out in the prpl and put in an imgstore instead of just being
passed in the same huge as char string as the actual message. This
is good because it's prpl agnostic, or something. It also means
we don't have a silly length of "-1" with pretty much every send or
receive IM function.
It should be crash free, bug free, and memleak free, but additional
testing is always a good thing.
If you like good stuff then you'll love this patch. But don't take
my word for it--ba dun dunt!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 27 Sep 2003 19:17:21 +0000 |
parents | 8ab95f4c9800 |
children | feb3d21a7794 |
comparison
equal
deleted
inserted
replaced
6981:abd3c684da31 | 6982:083d1e4a9c78 |
---|---|
101 /** | 101 /** |
102 * Flags applicable to a message. Most will have send, recv or system. | 102 * Flags applicable to a message. Most will have send, recv or system. |
103 */ | 103 */ |
104 typedef enum | 104 typedef enum |
105 { | 105 { |
106 GAIM_MESSAGE_SEND = 0x0001, /**< Outgoing message. */ | 106 GAIM_MESSAGE_SEND = 0x0001, /**< Outgoing message. */ |
107 GAIM_MESSAGE_RECV = 0x0002, /**< Incoming message. */ | 107 GAIM_MESSAGE_RECV = 0x0002, /**< Incoming message. */ |
108 GAIM_MESSAGE_SYSTEM = 0x0004, /**< System message. */ | 108 GAIM_MESSAGE_SYSTEM = 0x0004, /**< System message. */ |
109 GAIM_MESSAGE_AUTO_RESP = 0x0008, /**< Auto response. */ | 109 GAIM_MESSAGE_AUTO_RESP = 0x0008, /**< Auto response. */ |
110 GAIM_MESSAGE_COLORIZE = 0x0010, /**< Colorize nicks. */ | 110 GAIM_MESSAGE_COLORIZE = 0x0010, /**< Colorize nicks. */ |
111 GAIM_MESSAGE_NICK = 0x0020, /**< Contains your nick. */ | 111 GAIM_MESSAGE_NICK = 0x0020, /**< Contains your nick. */ |
112 GAIM_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */ | 112 GAIM_MESSAGE_NO_LOG = 0x0040, /**< Do not log. */ |
113 GAIM_MESSAGE_WHISPER = 0x0080 /**< Whispered message. */ | 113 GAIM_MESSAGE_WHISPER = 0x0080, /**< Whispered message. */ |
114 | 114 GAIM_MESSAGE_IMAGES = 0x0100 /**< Message contains images. */ |
115 } GaimMessageFlags; | 115 } GaimMessageFlags; |
116 | 116 |
117 #include "account.h" | 117 #include "account.h" |
118 #include "buddyicon.h" | 118 #include "buddyicon.h" |
119 #include "server.h" | 119 #include "server.h" |
154 { | 154 { |
155 void (*destroy_conversation)(GaimConversation *conv); | 155 void (*destroy_conversation)(GaimConversation *conv); |
156 void (*write_chat)(GaimConversation *conv, const char *who, | 156 void (*write_chat)(GaimConversation *conv, const char *who, |
157 const char *message, GaimMessageFlags flags, time_t mtime); | 157 const char *message, GaimMessageFlags flags, time_t mtime); |
158 void (*write_im)(GaimConversation *conv, const char *who, | 158 void (*write_im)(GaimConversation *conv, const char *who, |
159 const char *message, size_t len, GaimMessageFlags flags, time_t mtime); | 159 const char *message, GaimMessageFlags flags, time_t mtime); |
160 void (*write_conv)(GaimConversation *conv, const char *who, | 160 void (*write_conv)(GaimConversation *conv, const char *who, |
161 const char *message, size_t length, GaimMessageFlags flags, | 161 const char *message, GaimMessageFlags flags, |
162 time_t mtime); | 162 time_t mtime); |
163 | 163 |
164 void (*chat_add_user)(GaimConversation *conv, const char *user); | 164 void (*chat_add_user)(GaimConversation *conv, const char *user); |
165 void (*chat_add_users)(GaimConversation *conv, GList *users); | 165 void (*chat_add_users)(GaimConversation *conv, GList *users); |
166 void (*chat_rename_user)(GaimConversation *conv, | 166 void (*chat_rename_user)(GaimConversation *conv, |
752 * the conversation window." | 752 * the conversation window." |
753 * | 753 * |
754 * @param conv The conversation. | 754 * @param conv The conversation. |
755 * @param who The user who sent the message. | 755 * @param who The user who sent the message. |
756 * @param message The message. | 756 * @param message The message. |
757 * @param length The length of the message. | |
758 * @param flags The message flags. | 757 * @param flags The message flags. |
759 * @param mtime The time the message was sent. | 758 * @param mtime The time the message was sent. |
760 * | 759 * |
761 * @see gaim_im_write() | 760 * @see gaim_im_write() |
762 * @see gaim_chat_write() | 761 * @see gaim_chat_write() |
763 */ | 762 */ |
764 void gaim_conversation_write(GaimConversation *conv, const char *who, | 763 void gaim_conversation_write(GaimConversation *conv, const char *who, |
765 const char *message, size_t length, GaimMessageFlags flags, | 764 const char *message, GaimMessageFlags flags, |
766 time_t mtime); | 765 time_t mtime); |
767 | 766 |
768 /** | 767 /** |
769 * Updates the progress bar on a conversation window | 768 * Updates the progress bar on a conversation window |
770 * (if one exists in the UI). | 769 * (if one exists in the UI). |
918 */ | 917 */ |
919 void gaim_im_update_typing(GaimIm *im); | 918 void gaim_im_update_typing(GaimIm *im); |
920 | 919 |
921 /** | 920 /** |
922 * Writes to an IM. | 921 * Writes to an IM. |
923 * | |
924 * The @a len parameter is used for writing binary data, such as an | |
925 * image. If @c message is text, specify -1 for @a len. | |
926 * | 922 * |
927 * @param im The IM. | 923 * @param im The IM. |
928 * @param who The user who sent the message. | 924 * @param who The user who sent the message. |
929 * @param message The message to write. | 925 * @param message The message to write. |
930 * @param len The length of the message, or -1 to specify the length | |
931 * of @a message. | |
932 * @param flags The message flags. | 926 * @param flags The message flags. |
933 * @param mtime The time the message was sent. | 927 * @param mtime The time the message was sent. |
934 */ | 928 */ |
935 void gaim_im_write(GaimIm *im, const char *who, | 929 void gaim_im_write(GaimIm *im, const char *who, |
936 const char *message, size_t len, GaimMessageFlags flags, time_t mtime); | 930 const char *message, GaimMessageFlags flags, time_t mtime); |
937 | 931 |
938 /** | 932 /** |
939 * Sends a message to this IM conversation. | 933 * Sends a message to this IM conversation. |
940 * | 934 * |
941 * @param im The IM. | 935 * @param im The IM. |