Mercurial > pidgin
comparison src/protocols/oscar/msgcookie.c @ 8866:c2dff943e240
[gaim-migrate @ 9634]
(14:10:22) Faceprint: the timestamp plugin will now mislead users
(14:10:54) Me: which way does ichat behave?
(14:10:58) Me: i think the new way
(14:11:05) Me: but its been some time since i've seen it
(14:11:09) Faceprint: i don't know or care, the new behavior will confuse
the hell out of people
(14:11:22) Faceprint: lets say we have a conversation
(14:11:25) Faceprint: 2:00 gets printed by the plugin
(14:11:36) Faceprint: then we say nothing for 3 hours
(14:11:42) Faceprint: and then one of us says something
(14:12:04) Faceprint: that will be printed, and then as many as 5 minutes
later, the plugin will print 5:05
(14:12:23) Me: yes yes yes, i see both sides of this one. i tend to think
the new behavior is better, but i'll revert it
(14:12:36) Faceprint: since "normal" timestamps are turned off, it appears
as though what was just said was said around 2
(14:12:43) Faceprint: no, don't revert, fix
(14:12:53) Faceprint: preferably, make the patch writer fix
(14:12:57) Me: *nods*
(14:13:06) Me: which requires reverting since otherwise he won't be
motivated
(14:13:13) Faceprint: if something is said and we've gone more than 5 min
w/o printing a timestamp, print a timestamp before writing to the conv
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Mon, 03 May 2004 18:13:39 +0000 |
| parents | 697221d5d0ff |
| children | 1a97d5e88d12 |
comparison
equal
deleted
inserted
replaced
| 8865:12791b1a13ee | 8866:c2dff943e240 |
|---|---|
| 14 #define FAIM_INTERNAL | 14 #define FAIM_INTERNAL |
| 15 #include <aim.h> | 15 #include <aim.h> |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * aim_cachecookie - appends a cookie to the cookie list | 18 * aim_cachecookie - appends a cookie to the cookie list |
| 19 * @sess: session to add to | |
| 20 * @cookie: pointer to struct to append | |
| 21 * | 19 * |
| 22 * if cookie->cookie for type cookie->type is found, updates the | 20 * if cookie->cookie for type cookie->type is found, updates the |
| 23 * ->addtime of the found structure; otherwise adds the given cookie | 21 * ->addtime of the found structure; otherwise adds the given cookie |
| 24 * to the cache | 22 * to the cache |
| 25 * | 23 * |
| 26 * returns -1 on error, 0 on append, 1 on update. the cookie you pass | 24 * @param sess session to add to |
| 27 * in may be free'd, so don't count on its value after calling this! | 25 * @param cookie pointer to struct to append |
| 28 * | 26 * @return returns -1 on error, 0 on append, 1 on update. the cookie you pass |
| 27 * in may be free'd, so don't count on its value after calling this! | |
| 29 */ | 28 */ |
| 30 faim_internal int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie) | 29 faim_internal int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie) |
| 31 { | 30 { |
| 32 aim_msgcookie_t *newcook; | 31 aim_msgcookie_t *newcook; |
| 33 | 32 |
| 50 return 0; | 49 return 0; |
| 51 } | 50 } |
| 52 | 51 |
| 53 /** | 52 /** |
| 54 * aim_uncachecookie - grabs a cookie from the cookie cache (removes it from the list) | 53 * aim_uncachecookie - grabs a cookie from the cookie cache (removes it from the list) |
| 55 * @sess: session to grab cookie from | |
| 56 * @cookie: cookie string to look for | |
| 57 * @type: cookie type to look for | |
| 58 * | 54 * |
| 59 * takes a cookie string and a cookie type and finds the cookie struct associated with that duple, removing it from the cookie list ikn the process. | 55 * takes a cookie string and a cookie type and finds the cookie struct associated with that duple, removing it from the cookie list ikn the process. |
| 60 * | 56 * |
| 61 * if found, returns the struct; if none found (or on error), returns NULL: | 57 * @param sess session to grab cookie from |
| 58 * @param cookie cookie string to look for | |
| 59 * @param type cookie type to look for | |
| 60 * @return if found, returns the struct; if none found (or on error), returns NULL: | |
| 62 */ | 61 */ |
| 63 faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, fu8_t *cookie, int type) | 62 faim_internal aim_msgcookie_t *aim_uncachecookie(aim_session_t *sess, fu8_t *cookie, int type) |
| 64 { | 63 { |
| 65 aim_msgcookie_t *cur, **prev; | 64 aim_msgcookie_t *cur, **prev; |
| 66 | 65 |
| 79 return NULL; | 78 return NULL; |
| 80 } | 79 } |
| 81 | 80 |
| 82 /** | 81 /** |
| 83 * aim_mkcookie - generate an aim_msgcookie_t *struct from a cookie string, a type, and a data pointer. | 82 * aim_mkcookie - generate an aim_msgcookie_t *struct from a cookie string, a type, and a data pointer. |
| 84 * @c: pointer to the cookie string array | |
| 85 * @type: cookie type to use | |
| 86 * @data: data to be cached with the cookie | |
| 87 * | 83 * |
| 88 * returns NULL on error, a pointer to the newly-allocated cookie on | 84 * @param c pointer to the cookie string array |
| 89 * success. | 85 * @param type cookie type to use |
| 90 * | 86 * @param data data to be cached with the cookie |
| 87 * @return returns NULL on error, a pointer to the newly-allocated | |
| 88 * cookie on success. | |
| 91 */ | 89 */ |
| 92 faim_internal aim_msgcookie_t *aim_mkcookie(fu8_t *c, int type, void *data) | 90 faim_internal aim_msgcookie_t *aim_mkcookie(fu8_t *c, int type, void *data) |
| 93 { | 91 { |
| 94 aim_msgcookie_t *cookie; | 92 aim_msgcookie_t *cookie; |
| 95 | 93 |
| 106 return cookie; | 104 return cookie; |
| 107 } | 105 } |
| 108 | 106 |
| 109 /** | 107 /** |
| 110 * aim_checkcookie - check to see if a cookietuple has been cached | 108 * aim_checkcookie - check to see if a cookietuple has been cached |
| 111 * @sess: session to check for the cookie in | |
| 112 * @cookie: pointer to the cookie string array | |
| 113 * @type: type of the cookie to look for | |
| 114 * | 109 * |
| 115 * this returns a pointer to the cookie struct (still in the list) on | 110 * @param sess session to check for the cookie in |
| 116 * success; returns NULL on error/not found | 111 * @param cookie pointer to the cookie string array |
| 117 * | 112 * @param type type of the cookie to look for |
| 113 * @return returns a pointer to the cookie struct (still in the list) | |
| 114 * on success; returns NULL on error/not found | |
| 118 */ | 115 */ |
| 119 | 116 |
| 120 faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const fu8_t *cookie, int type) | 117 faim_internal aim_msgcookie_t *aim_checkcookie(aim_session_t *sess, const fu8_t *cookie, int type) |
| 121 { | 118 { |
| 122 aim_msgcookie_t *cur; | 119 aim_msgcookie_t *cur; |
| 144 } | 141 } |
| 145 #endif | 142 #endif |
| 146 | 143 |
| 147 /** | 144 /** |
| 148 * aim_cookie_free - free an aim_msgcookie_t struct | 145 * aim_cookie_free - free an aim_msgcookie_t struct |
| 149 * @sess: session to remove the cookie from | |
| 150 * @cookiep: the address of a pointer to the cookie struct to remove | |
| 151 * | 146 * |
| 152 * this function removes the cookie *cookie from teh list of cookies | 147 * this function removes the cookie *cookie from teh list of cookies |
| 153 * in sess, and then frees all memory associated with it. including | 148 * in sess, and then frees all memory associated with it. including |
| 154 * its data! if you want to use the private data after calling this, | 149 * its data! if you want to use the private data after calling this, |
| 155 * make sure you copy it first. | 150 * make sure you copy it first. |
| 156 * | 151 * |
| 157 * returns -1 on error, 0 on success. | 152 * @param sess session to remove the cookie from |
| 153 * @param cookie the address of a pointer to the cookie struct to remove | |
| 154 * @return returns -1 on error, 0 on success. | |
| 158 * | 155 * |
| 159 */ | 156 */ |
| 160 faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie) | 157 faim_internal int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie) |
| 161 { | 158 { |
| 162 aim_msgcookie_t *cur, **prev; | 159 aim_msgcookie_t *cur, **prev; |
