changeset 285:0e683f493edb

Update msg_new to push default application id in new messages
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 19 Dec 2008 17:24:10 +0900
parents 9d4f11540367
children 95d5e12ea2bc
files waaad/message.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/waaad/message.c	Fri Dec 19 17:15:39 2008 +0900
+++ b/waaad/message.c	Fri Dec 19 17:24:10 2008 +0900
@@ -1409,6 +1409,7 @@
 	_msg_t *new = NULL;
 	dict_object_type_t dicttype;
 	dict_cmd_data_t    dictdata;
+	dict_object_t     *dictappl;
 	
 	TRACE_ENTRY("%p %x %p", model, flags, msg);
 	
@@ -1435,6 +1436,14 @@
 	new->msg_public.msg_flags	= dictdata.cmd_flag_val;
 	new->msg_public.msg_code	= dictdata.cmd_code;
 	
+	/* Initialize application from the parent, if any */
+	CHECK_FCT(  dict_search( DICT_APPLICATION, APPLICATION_OF_COMMAND, model, &dictappl)  );
+	if (dictappl != NULL) {
+		dict_application_data_t appdata;
+		CHECK_FCT(  dict_getval(dictappl, &appdata)  );
+		new->msg_public.msg_appl = appdata.application_id;
+	}
+	
 	if (flags & MSGFL_ALLOW_ETEID) {
 		new->msg_public.msg_eteid = msg_get_eteid();
 	}
"Welcome to our mercurial repository"