Compare commits
7 Commits
v1.0.0-bet
...
v1.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bcd9d3607 | ||
|
|
e4ebf5eb80 | ||
|
|
1428ec4d49 | ||
|
|
839e46360e | ||
|
|
d0064dd647 | ||
|
|
b9693d53ec | ||
|
|
f6ba40046f |
@@ -5,7 +5,7 @@ packages:
|
|||||||
sources:
|
sources:
|
||||||
- https://git.sr.ht/~emersion/gamja
|
- https://git.sr.ht/~emersion/gamja
|
||||||
secrets:
|
secrets:
|
||||||
- 5874ac5a-905e-4596-a117-fed1401c60ce # deploy SSH key
|
- 77c7956b-003e-44f7-bb5c-2944b2047654 # deploy SSH key
|
||||||
tasks:
|
tasks:
|
||||||
- setup: |
|
- setup: |
|
||||||
cd gamja
|
cd gamja
|
||||||
@@ -16,4 +16,4 @@ tasks:
|
|||||||
[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)" ] || complete-build
|
[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/master)" ] || complete-build
|
||||||
rsync --rsh="ssh -o StrictHostKeyChecking=no" -rP \
|
rsync --rsh="ssh -o StrictHostKeyChecking=no" -rP \
|
||||||
--delete --exclude=config.json \
|
--delete --exclude=config.json \
|
||||||
. deploy@emersion.fr:/srv/http/gamja
|
. deploy@sheeta.emersion.fr:/srv/http/gamja
|
||||||
|
|||||||
@@ -414,17 +414,14 @@ export default class App extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendReadReceipt(client, storedBuffer) {
|
sendReadReceipt(client, storedBuffer) {
|
||||||
if (!client.caps.enabled.has("soju.im/read")) {
|
if (!client.supportsReadMarker()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let readReceipt = storedBuffer.receipts[ReceiptType.READ];
|
let readReceipt = storedBuffer.receipts[ReceiptType.READ];
|
||||||
if (storedBuffer.name === "*" || !readReceipt) {
|
if (storedBuffer.name === "*" || !readReceipt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
client.send({
|
client.setReadMarker(storedBuffer.name, readReceipt.time);
|
||||||
command: "READ",
|
|
||||||
params: [storedBuffer.name, "timestamp="+readReceipt.time],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switchBuffer(id) {
|
switchBuffer(id) {
|
||||||
@@ -745,7 +742,12 @@ export default class App extends Component {
|
|||||||
if (client.cm(msg.prefix.name) === client.cm(client.serverPrefix.name)) {
|
if (client.cm(msg.prefix.name) === client.cm(client.serverPrefix.name)) {
|
||||||
target = SERVER_BUFFER;
|
target = SERVER_BUFFER;
|
||||||
} else {
|
} else {
|
||||||
target = msg.prefix.name;
|
let context = msg.tags['+draft/channel-context'];
|
||||||
|
if (context && client.isChannel(context) && State.getBuffer(this.state, { server: serverID, name: context })) {
|
||||||
|
target = context;
|
||||||
|
} else {
|
||||||
|
target = msg.prefix.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg.command === "NOTICE" && !State.getBuffer(this.state, { server: serverID, name: target })) {
|
if (msg.command === "NOTICE" && !State.getBuffer(this.state, { server: serverID, name: target })) {
|
||||||
@@ -865,6 +867,7 @@ export default class App extends Component {
|
|||||||
case "CHATHISTORY":
|
case "CHATHISTORY":
|
||||||
case "ACK":
|
case "ACK":
|
||||||
case "BOUNCER":
|
case "BOUNCER":
|
||||||
|
case "MARKREAD":
|
||||||
case "READ":
|
case "READ":
|
||||||
// Ignore these
|
// Ignore these
|
||||||
return [];
|
return [];
|
||||||
@@ -1015,6 +1018,7 @@ export default class App extends Component {
|
|||||||
this.autoOpenURL = null;
|
this.autoOpenURL = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "MARKREAD":
|
||||||
case "READ":
|
case "READ":
|
||||||
target = msg.params[0];
|
target = msg.params[0];
|
||||||
let bound = msg.params[1];
|
let bound = msg.params[1];
|
||||||
@@ -1223,11 +1227,8 @@ export default class App extends Component {
|
|||||||
});
|
});
|
||||||
client.monitor(target);
|
client.monitor(target);
|
||||||
|
|
||||||
if (client.caps.enabled.has("soju.im/read")) {
|
if (client.supportsReadMarker()) {
|
||||||
client.send({
|
client.fetchReadMarker(target);
|
||||||
command: "READ",
|
|
||||||
params: [target],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ export default function BufferHeader(props) {
|
|||||||
} else {
|
} else {
|
||||||
if (fullyConnected) {
|
if (fullyConnected) {
|
||||||
actions.push(joinButton);
|
actions.push(joinButton);
|
||||||
actions.push(settingsButton);
|
|
||||||
} else if (props.server.status === ServerStatus.DISCONNECTED) {
|
} else if (props.server.status === ServerStatus.DISCONNECTED) {
|
||||||
actions.push(reconnectButton);
|
actions.push(reconnectButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,10 @@ class LogLine extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (msg.tags["+draft/channel-context"]) {
|
||||||
|
content = html`<em>(only visible to you)</em> ${content}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.isHighlight) {
|
if (msg.isHighlight) {
|
||||||
lineClass += " highlight";
|
lineClass += " highlight";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1015,4 +1015,32 @@ export default class Client extends EventTarget {
|
|||||||
return { message: msg.params[2] };
|
return { message: msg.params[2] };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
supportsReadMarker() {
|
||||||
|
return this.caps.enabled.has("draft/read-marker") || this.caps.enabled.has("soju.im/read");
|
||||||
|
}
|
||||||
|
|
||||||
|
_markReadCmd() {
|
||||||
|
if (this.caps.enabled.has("draft/read-marker")) {
|
||||||
|
return "MARKREAD";
|
||||||
|
} else if (this.caps.enabled.has("soju.im/read")) {
|
||||||
|
return "READ";
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchReadMarker(target) {
|
||||||
|
this.send({
|
||||||
|
command: this._markReadCmd(),
|
||||||
|
params: [target],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setReadMarker(target, t) {
|
||||||
|
this.send({
|
||||||
|
command: this._markReadCmd(),
|
||||||
|
params: [target, "timestamp="+t],
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user