@@ -84,19 +84,20 @@ protected boolean isRobotAnswer() {
84
84
* @return The elaborated messages with command tokens expanded
85
85
*/
86
86
private String parseRobotAnswer (String message ) {
87
- RegExp p = RegExp .compile ("\\ [act\\ [[a-zA-Z]*\\ |.*\\ |.*\\ ]act\\ ]" );
88
- MatchResult result = p .exec (message );
89
-
90
- if (result != null ) {
91
- for (int i = 0 ; i < result .getGroupCount (); i ++) {
92
- String match = result .getGroup (i );
93
- match = match .replace (ACT_START , "" );
94
- match = match .replace (ACT_END , "" );
95
- String link = processCommand (match .split ("\\ |" ));
96
- message = message .replace (ACT_START + match + ACT_END , link );
87
+ RegExp p = RegExp .compile ("\\ [act\\ [([^\\ ]]+)]act\\ ]" , "g" );
88
+ MatchResult result ;
89
+
90
+ while ((result = p .exec (message )) != null ) {
91
+ if (result .getGroupCount () > 1 ) {
92
+ String fullMatch = result .getGroup (0 ); // whole [act[...]]act]
93
+ String matchContent = result .getGroup (1 ); // inner part
94
+
95
+ String [] parts = matchContent .split ("\\ |" );
96
+ String link = processCommand (parts );
97
+
98
+ message = message .replace (fullMatch , link );
97
99
}
98
100
}
99
-
100
101
return message ;
101
102
}
102
103
@@ -132,7 +133,7 @@ public static native void declareOpenDocument(DocumentsPanel panel) /*-{
132
133
return panel.@com.logicaldoc.gui.frontend.client.document.DocumentsPanel::openInFolder(J)(docId);
133
134
};
134
135
}-*/ ;
135
-
136
+
136
137
@ UnsafeNativeLong
137
138
public static native void declareOpenFolder (FolderNavigator navigator ) /*-{
138
139
$wnd.actOpenFolder = function(folderId) {
0 commit comments