| 2033 */ |
2033 */ |
| 2034 static MsimMessage * |
2034 static MsimMessage * |
| 2035 msim_do_postprocessing(MsimMessage *msg, const gchar *uid_before, |
2035 msim_do_postprocessing(MsimMessage *msg, const gchar *uid_before, |
| 2036 const gchar *uid_field_name, guint uid) |
2036 const gchar *uid_field_name, guint uid) |
| 2037 { |
2037 { |
| |
2038 MsimMessageElement *elem; |
| 2038 msim_msg_dump("msim_do_postprocessing msg: %s\n", msg); |
2039 msim_msg_dump("msim_do_postprocessing msg: %s\n", msg); |
| 2039 |
2040 |
| 2040 /* First, check - if the field already exists, replace <uid> within it */ |
2041 /* First, check - if the field already exists, replace <uid> within it */ |
| 2041 if (msim_msg_get(msg, uid_field_name)) { |
2042 if ((elem = msim_msg_get(msg, uid_field_name)) != NULL) { |
| 2042 MsimMessageElement *elem; |
|
| 2043 gchar *fmt_string; |
2043 gchar *fmt_string; |
| 2044 gchar *uid_str, *new_str; |
2044 gchar *uid_str, *new_str; |
| 2045 |
|
| 2046 /* Warning: this is a delicate, but safe, operation */ |
|
| 2047 |
|
| 2048 elem = msim_msg_get(msg, uid_field_name); |
|
| 2049 |
2045 |
| 2050 /* Get the packed element, flattening it. This allows <uid> to be |
2046 /* Get the packed element, flattening it. This allows <uid> to be |
| 2051 * replaced within nested data structures, since the replacement is done |
2047 * replaced within nested data structures, since the replacement is done |
| 2052 * on the linear, packed data, not on a complicated data structure. |
2048 * on the linear, packed data, not on a complicated data structure. |
| 2053 * |
2049 * |