forked from cory/tildefriends
		
	Slightly improved error handling, some heuristics for number of cores to build with, and misc. work in progress changes.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3246 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -233,6 +233,11 @@ function updateWindows() { | ||||
|  | ||||
| function updateConversation() { | ||||
| 	if (gCurrentConversation) { | ||||
| 		terminal.cork(); | ||||
| 		terminal.clear(); | ||||
| 		terminal.print("..."); | ||||
| 		terminal.uncork(); | ||||
|  | ||||
| 		Promise.all([ | ||||
| 			gCurrentConversation.session.getHistory(gCurrentConversation.name), | ||||
| 			gCurrentConversation.session.getParticipants(gCurrentConversation.name), | ||||
| @@ -405,7 +410,7 @@ function formatMessage(message) { | ||||
| 	var result; | ||||
| 	if (typeof message == "string") { | ||||
| 		for (let i = 0; i < message.length; i++) { | ||||
| 			if (message.charCodeAt(i) > 128 && message.charCodeAt(i) < 256) { | ||||
| 			if (message.charCodeAt(i) >= 128 /*&& message.charCodeAt(i) < 256*/) { | ||||
| 				message = message.substring(0, i) + "?" + message.substring(i + 1); | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
| @@ -48,7 +48,12 @@ exports.ChatService = class { | ||||
| 		for (let i = self._callbacks.length - 1; i >= 0; i--) { | ||||
| 			let callback = self._callbacks[i]; | ||||
| 			try { | ||||
| 				callback(message); | ||||
| 				callback(message).catch(function(error) { | ||||
| 					self._callbacks.splice(i, 1); | ||||
|  | ||||
| 					// XXX: Send it to the other connections? | ||||
| 					print(error); | ||||
| 				}); | ||||
| 			} catch (error) { | ||||
| 				self._callbacks.splice(i, 1); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user