forked from cory/tildefriends
		
	Backlog of miscellaneous fixes.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3234 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -11,6 +11,7 @@ function updateTitle() { | ||||
| 	terminal.setTitle((gUnread ? "(" + gUnread.toString() + ") " : "") + "Chat"); | ||||
| } | ||||
|  | ||||
| let kMaxHistory = 32; | ||||
| let kAccountsKey = JSON.stringify(["accounts", core.user.name]); | ||||
| let kStateKey = JSON.stringify(["state", core.user.name]); | ||||
|  | ||||
| @@ -218,6 +219,9 @@ function updateConversation() { | ||||
| 			let history = data[0]; | ||||
| 			let participants = data[1]; | ||||
| 			gCurrentConversation.messages = history || []; | ||||
| 			if (gCurrentConversation.messages.length > kMaxHistory) { | ||||
| 				gCurrentConversation.messages.splice(0, gCurrentConversation.messages.length - kMaxHistory); | ||||
| 			} | ||||
| 			gCurrentConversation.participants = participants || []; | ||||
| 			terminal.cork(); | ||||
| 			terminal.select("terminal"); | ||||
| @@ -227,7 +231,7 @@ function updateConversation() { | ||||
| 				if (message.action == "message") { | ||||
| 					printMessage(message.message); | ||||
| 				} else { | ||||
| 					terminal.print(message); | ||||
| 					terminal.print(message.message); | ||||
| 				} | ||||
| 			} | ||||
| 			updateUsers(); | ||||
| @@ -283,6 +287,7 @@ function getConversation(session, conversationName) { | ||||
| 			sendMessage: function(message) { | ||||
| 				return session.sendMessage(key, message); | ||||
| 			}, | ||||
| 			participants: [], | ||||
| 		}; | ||||
| 		updateWindows(); | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user