Index: src/game_events.cpp
===================================================================
--- src/game_events.cpp	(révision 53643)
+++ src/game_events.cpp	(copie de travail)
@@ -2739,14 +2739,21 @@
 	unit_map::iterator speaker;
 	vconfig text_input_element;
 	bool has_text_input;
+	int _max_lifetime;
 	const std::vector<std::string> &options;
 
 	message_user_choice(const vconfig &c, const unit_map::iterator &s,
 		const vconfig &t, bool ht, const std::vector<std::string> &o)
 		: cfg(c), speaker(s), text_input_element(t)
 		, has_text_input(ht), options(o)
	{}

+    void set_max_lifetime(int max_lifetime)
+     {
+         _max_lifetime = max_lifetime;
+     }
+
 	virtual config query_user() const
 	{
 		std::string image = get_image(cfg, speaker);
@@ -2773,7 +2780,7 @@
 			resources::screen->video(), caption, cfg["message"],
 			image, false, has_text_input, text_input_label,
 			&text_input_content, input_max_size, options,
-			&option_chosen);
+			&option_chosen, _max_lifetime);
 
 		/* Since gui2::show_wml_message needs to do undrawing the
 		   chatlines can get garbled and look dirty on screen. Force a
@@ -2809,6 +2816,8 @@
 
 	bool has_input= (has_text_input || !menu_items.empty() );
 
+	std::string max_lifetime = cfg["duration"];
+
 	// skip messages during quick replay
 	play_controller *controller = resources::controller;
 	if(!has_input && (
@@ -2901,6 +2910,10 @@
 
 	message_user_choice msg(cfg, speaker, text_input_element, has_text_input,
 		options);
+
+    	/* Add the lifetime of the message */
+    	(!max_lifetime.empty()) ? msg.set_max_lifetime(lexical_cast< int, const std::string & >	(max_lifetime)) : msg.set_max_lifetime(0);
+
 	if (!has_input)
 	{
 		/* Always show the dialog if it has no input, whether we are
Index: src/gui/dialogs/wml_message.cpp
===================================================================
--- src/gui/dialogs/wml_message.cpp	(révision 53643)
+++ src/gui/dialogs/wml_message.cpp	(copie de travail)
@@ -171,7 +171,8 @@
 		, std::string* input_text
 		, const unsigned maximum_length
 		, const std::vector<std::string>& option_list
-		, int* chosen_option)
+		, int* chosen_option
+		, int max_duration_)
 {
 	std::auto_ptr<twml_message_> dlg;
 	if(left_side) {
@@ -189,7 +190,7 @@
 		dlg->set_option_list(option_list, chosen_option);
 	}
 
-	dlg->show(video);
+	dlg->show(video, max_duration_);
 	return dlg->get_retval();
 }
 
Index: src/gui/dialogs/wml_message.hpp
===================================================================
--- src/gui/dialogs/wml_message.hpp	(révision 53643)
+++ src/gui/dialogs/wml_message.hpp	(copie de travail)
@@ -42,6 +42,7 @@
 		, input_maximum_lenght_(0)
 		, option_list_()
 		, chosen_option_(NULL)
+		, max_duration_(0)
 	{
 	}
 
@@ -97,11 +98,16 @@
 	/** The chosen option. */
 	int *chosen_option_;
 
+	/** The maximum duration. **/
+    	int max_duration_;
+
 	/** Inherited from tdialog. */
 	void pre_show(CVideo& video, twindow& window);
 
 	/** Inherited from tdialog. */
 	void post_show(twindow& window);
+
+
 };
 
 /** Shows a dialog with the portrait on the left side. */
@@ -160,6 +166,8 @@
  *  @param chosen_option          Pointer to the initially chosen option.
  *                                Will be set to the chosen_option when the
  *                                dialog closes.
+ *
+ *  @param max_duration	   Maximum duration of the message (if specified)
  */
 int show_wml_message(const bool left_side
 		, CVideo& video
@@ -172,7 +180,8 @@
 		, std::string* input_text
 	    , const unsigned maximum_length
 		, const std::vector<std::string>& option_list
-		, int* chosen_option);
+		, int* chosen_option
+		, int max_duration_);
 
 
 } // namespace gui2