Thu, 08 May 2003 06:14:16 +0000
[gaim-migrate @ 5708]
We should now get notifications when the MSN server is about to go down
(specifying the number of minutes). This would have been great to have last
night ;)
Also, added some checks so people can't spoof system messages, e-mail
messages, etc.
| 4542 | 1 | /** |
| 2 | * @file msg.h Message functions | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
6 | * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
| 4542 | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | */ | |
| 22 | #ifndef _MSN_MSG_H_ | |
| 23 | #define _MSN_MSG_H_ | |
| 24 | ||
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
25 | typedef struct _MsnMessage MsnMessage; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
26 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
27 | #include "session.h" |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
28 | #include "user.h" |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
29 | |
| 4542 | 30 | /** |
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
31 | * A message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
32 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
33 | struct _MsnMessage |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
34 | { |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
35 | MsnUser *sender; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
36 | MsnUser *receiver; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
37 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
38 | unsigned int tid; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
39 | char flag; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
40 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
41 | gboolean incoming; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
42 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
43 | size_t size; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
44 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
45 | char *content_type; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
46 | char *charset; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
47 | char *body; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
48 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
49 | GHashTable *attr_table; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
50 | GList *attr_list; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
51 | }; |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
52 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
53 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
54 | * Creates a new, empty message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
55 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
56 | * @return A new message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
57 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
58 | MsnMessage *msn_message_new(void); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
59 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
60 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
61 | * Creates a new message based off a string. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
62 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
63 | * @param session The MSN session. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
64 | * @param str The string. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
65 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
66 | * @return The new message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
67 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
68 | MsnMessage *msn_message_new_from_str(MsnSession *session, const char *str); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
69 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
70 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
71 | * Destroys a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
72 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
73 | void msn_message_destroy(MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
74 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
75 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
76 | * Converts a message to a string. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
77 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
78 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
79 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
80 | * @return The string representation of a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
81 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
82 | char *msn_message_build_string(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
83 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
84 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
85 | * Returns TRUE if the message is outgoing. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
86 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
87 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
88 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
89 | * @return @c TRUE if the message is outgoing, or @c FALSE otherwise. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
90 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
91 | gboolean msn_message_is_outgoing(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
92 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
93 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
94 | * Returns TRUE if the message is incoming. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
95 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
96 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
97 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
98 | * @return @c TRUE if the message is incoming, or @c FALSE otherwise. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
99 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
100 | gboolean msn_message_is_incoming(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
101 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
102 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
103 | * Sets the message's sender. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
104 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
105 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
106 | * @param user The sender. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
107 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
108 | void msn_message_set_sender(MsnMessage *msg, MsnUser *user); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
109 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
110 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
111 | * Returns the message's sender. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
112 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
113 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
114 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
115 | * @return The sender. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
116 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
117 | MsnUser *msn_message_get_sender(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
118 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
119 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
120 | * Sets the message's receiver. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
121 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
122 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
123 | * @param user The receiver. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
124 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
125 | void msn_message_set_receiver(MsnMessage *msg, MsnUser *user); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
126 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
127 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
128 | * Returns the message's receiver. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
129 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
130 | * @param msg The message. |
| 4542 | 131 | * |
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
132 | * @return The receiver. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
133 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
134 | MsnUser *msn_message_get_receiver(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
135 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
136 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
137 | * Sets the message transaction ID. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
138 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
139 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
140 | * @param tid The transaction ID. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
141 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
142 | void msn_message_set_transaction_id(MsnMessage *msg, unsigned int tid); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
143 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
144 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
145 | * Returns the message transaction ID. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
146 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
147 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
148 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
149 | * @return The transaction ID. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
150 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
151 | unsigned int msn_message_get_transaction_id(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
152 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
153 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
154 | * Sets the flag for an outgoing message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
155 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
156 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
157 | * @param flag The flag. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
158 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
159 | void msn_message_set_flag(MsnMessage *msg, char flag); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
160 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
161 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
162 | * Returns the flag for an outgoing message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
163 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
164 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
165 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
166 | * @return The flag. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
167 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
168 | char msn_message_get_flag(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
169 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
170 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
171 | * Sets the body of a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
172 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
173 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
174 | * @param body The body of the message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
175 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
176 | void msn_message_set_body(MsnMessage *msg, const char *body); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
177 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
178 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
179 | * Returns the body of the message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
180 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
181 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
182 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
183 | * @return The body of the message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
184 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
185 | const char *msn_message_get_body(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
186 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
187 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
188 | * Sets the content type in a message. |
| 4542 | 189 | * |
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
190 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
191 | * @param type The content-type. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
192 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
193 | void msn_message_set_content_type(MsnMessage *msg, const char *type); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
194 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
195 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
196 | * Returns the content type in a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
197 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
198 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
199 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
200 | * @return The content-type. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
201 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
202 | const char *msn_message_get_content_type(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
203 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
204 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
205 | * Sets the charset in a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
206 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
207 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
208 | * @param charset The charset. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
209 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
210 | void msn_message_set_charset(MsnMessage *msg, const char *charset); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
211 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
212 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
213 | * Returns the charset in a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
214 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
215 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
216 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
217 | * @return The charset. |
| 4542 | 218 | */ |
|
5309
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
219 | const char *msn_message_get_charset(const MsnMessage *msg); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
220 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
221 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
222 | * Sets an attribute in a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
223 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
224 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
225 | * @param attr The attribute name. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
226 | * @param value The attribute value. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
227 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
228 | void msn_message_set_attr(MsnMessage *msg, const char *attr, |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
229 | const char *value); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
230 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
231 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
232 | * Returns an attribute from a message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
233 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
234 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
235 | * @param attr The attribute. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
236 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
237 | * @return The value, or @c NULL if not found. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
238 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
239 | const char *msn_message_get_attr(const MsnMessage *msg, const char *attr); |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
240 | |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
241 | /** |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
242 | * Parses the body and returns it in the form of a hashtable. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
243 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
244 | * @param msg The message. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
245 | * |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
246 | * @return The resulting hashtable. |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
247 | */ |
|
3178acad1449
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
4542
diff
changeset
|
248 | GHashTable *msn_message_get_hashtable_from_body(const MsnMessage *msg); |
| 4542 | 249 | |
| 250 | #endif /* _MSN_MSG_H_ */ |