mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 21:03:27 +02:00
Removed floofchat compatibility.
This commit is contained in:
parent
6e4899f2c8
commit
8882468f3e
1 changed files with 0 additions and 36 deletions
|
@ -28,7 +28,6 @@
|
||||||
var palData = AvatarManager.getPalData().data;
|
var palData = AvatarManager.getPalData().data;
|
||||||
|
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
Messages.subscribe("Chat"); // Floofchat
|
|
||||||
Messages.subscribe("chat");
|
Messages.subscribe("chat");
|
||||||
Messages.messageReceived.connect(receivedMessage);
|
Messages.messageReceived.connect(receivedMessage);
|
||||||
AvatarManager.avatarAddedEvent.connect((sessionId) => {
|
AvatarManager.avatarAddedEvent.connect((sessionId) => {
|
||||||
|
@ -104,10 +103,7 @@
|
||||||
const timeArray = _formatTimestamp(currentTimestamp);
|
const timeArray = _formatTimestamp(currentTimestamp);
|
||||||
|
|
||||||
if (!message.channel) message.channel = "domain"; // We don't know where to put this message. Assume it is a domain wide message.
|
if (!message.channel) message.channel = "domain"; // We don't know where to put this message. Assume it is a domain wide message.
|
||||||
if (message.forApp) return; // Floofchat
|
|
||||||
|
|
||||||
// Floofchat compatibility hook
|
|
||||||
message = floofChatCompatibilityConversion(message);
|
|
||||||
message.channel = message.channel.toLowerCase();
|
message.channel = message.channel.toLowerCase();
|
||||||
|
|
||||||
// Check the channel. If the channel is not one we have, do nothing.
|
// Check the channel. If the channel is not one we have, do nothing.
|
||||||
|
@ -216,8 +212,6 @@
|
||||||
action: "send_chat_message",
|
action: "send_chat_message",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
floofChatCompatibilitySendMessage(message, channel);
|
|
||||||
}
|
}
|
||||||
function _avatarAction(type, sessionId) {
|
function _avatarAction(type, sessionId) {
|
||||||
Script.setTimeout(() => {
|
Script.setTimeout(() => {
|
||||||
|
@ -304,34 +298,4 @@
|
||||||
function _emitEvent(packet = { type: "" }) {
|
function _emitEvent(packet = { type: "" }) {
|
||||||
chatOverlayWindow.sendToQml(packet);
|
chatOverlayWindow.sendToQml(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Floofchat compatibility functions
|
|
||||||
// Added to ease the transition between Floofchat to ArmoredChat
|
|
||||||
// These functions can be safely removed at a much later date.
|
|
||||||
function floofChatCompatibilityConversion(message) {
|
|
||||||
if (message.type === "TransmitChatMessage" && !message.forApp) {
|
|
||||||
return {
|
|
||||||
position: message.position,
|
|
||||||
message: message.message,
|
|
||||||
displayName: message.displayName,
|
|
||||||
channel: message.channel.toLowerCase(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
function floofChatCompatibilitySendMessage(message, channel) {
|
|
||||||
Messages.sendMessage(
|
|
||||||
"Chat",
|
|
||||||
JSON.stringify({
|
|
||||||
position: MyAvatar.position,
|
|
||||||
message: message,
|
|
||||||
displayName: MyAvatar.sessionDisplayName,
|
|
||||||
channel: channel.charAt(0).toUpperCase() + channel.slice(1),
|
|
||||||
type: "TransmitChatMessage",
|
|
||||||
forApp: "Floof",
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue