* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update CHANGELOG.md

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update CHANGELOG.md

* Update CHANGELOG.md

* wip

* Update CHANGELOG.md

* wip

* wip

* wip

* wip
This commit is contained in:
syuilo 2018-10-07 11:06:17 +09:00 committed by GitHub
parent 0b98a2364b
commit d0570d7fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
126 changed files with 1812 additions and 2273 deletions

View file

@ -21,23 +21,19 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
existMore: false,
connection: null,
connectionId: null
connection: null
};
},
mounted() {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection = (this as any).os.stream.useSharedConnection('main');
this.connection.on('mention', this.onNote);
this.fetch();
},
beforeDestroy() {
this.connection.off('mention', this.onNote);
(this as any).os.stream.dispose(this.connectionId);
this.connection.dispose();
},
methods: {

View file

@ -5,7 +5,6 @@
<script lang="ts">
import Vue from 'vue';
import XNotes from './deck.notes.vue';
import { HashtagStream } from '../../../../common/scripts/streaming/hashtag';
const fetchLimit = 10;
@ -48,7 +47,7 @@ export default Vue.extend({
mounted() {
if (this.connection) this.connection.close();
this.connection = new HashtagStream((this as any).os, this.$store.state.i, this.tagTl.query);
this.connection = (this as any).os.stream.connectToChannel('hashtag', this.tagTl.query);
this.connection.on('note', this.onNote);
this.fetch();

View file

@ -5,7 +5,6 @@
<script lang="ts">
import Vue from 'vue';
import XNotes from './deck.notes.vue';
import { UserListStream } from '../../../../common/scripts/streaming/user-list';
const fetchLimit = 10;

View file

@ -21,23 +21,19 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
existMore: false,
connection: null,
connectionId: null
connection: null
};
},
mounted() {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection = (this as any).os.stream.useSharedConnection('main');
this.connection.on('mention', this.onNote);
this.fetch();
},
beforeDestroy() {
this.connection.off('mention', this.onNote);
(this as any).os.stream.dispose(this.connectionId);
this.connection.dispose();
},
methods: {

View file

@ -70,12 +70,15 @@ import parse from '../../../../../../mfm/parse';
import MkNoteMenu from '../../../../common/views/components/note-menu.vue';
import MkReactionPicker from '../../../../common/views/components/reaction-picker.vue';
import XSub from './deck.note.sub.vue';
import noteSubscriber from '../../../../common/scripts/note-subscriber';
export default Vue.extend({
components: {
XSub
},
mixins: [noteSubscriber('note')],
props: {
note: {
type: Object,
@ -90,9 +93,7 @@ export default Vue.extend({
data() {
return {
showContent: false,
connection: null,
connectionId: null
showContent: false
};
},
@ -120,68 +121,7 @@ export default Vue.extend({
}
},
created() {
if (this.$store.getters.isSignedIn) {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
}
},
mounted() {
this.capture(true);
if (this.$store.getters.isSignedIn) {
this.connection.on('_connected_', this.onStreamConnected);
}
},
beforeDestroy() {
this.decapture(true);
if (this.$store.getters.isSignedIn) {
this.connection.off('_connected_', this.onStreamConnected);
(this as any).os.stream.dispose(this.connectionId);
}
},
methods: {
capture(withHandler = false) {
if (this.$store.getters.isSignedIn) {
const data = {
type: 'capture',
id: this.p.id
} as any;
if ((this.p.visibleUserIds || []).includes(this.$store.state.i.id) || (this.p.mentions || []).includes(this.$store.state.i.id)) {
data.read = true;
}
this.connection.send(data);
if (withHandler) this.connection.on('note-updated', this.onStreamNoteUpdated);
}
},
decapture(withHandler = false) {
if (this.$store.getters.isSignedIn) {
this.connection.send({
type: 'decapture',
id: this.p.id
});
if (withHandler) this.connection.off('note-updated', this.onStreamNoteUpdated);
}
},
onStreamConnected() {
this.capture();
},
onStreamNoteUpdated(data) {
const note = data.note;
if (note.id == this.note.id) {
this.$emit('update:note', note);
} else if (note.id == this.note.renoteId) {
this.note.renote = note;
}
},
reply() {
(this as any).apis.post({
reply: this.p

View file

@ -38,8 +38,7 @@ export default Vue.extend({
notifications: [],
queue: [],
moreNotifications: false,
connection: null,
connectionId: null
connection: null
};
},
@ -62,8 +61,7 @@ export default Vue.extend({
},
mounted() {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
this.connection = (this as any).os.stream.useSharedConnection('main');
this.connection.on('notification', this.onNotification);
@ -86,8 +84,7 @@ export default Vue.extend({
},
beforeDestroy() {
this.connection.off('notification', this.onNotification);
(this as any).os.stream.dispose(this.connectionId);
this.connection.dispose();
this.column.$off('top', this.onTop);
this.column.$off('bottom', this.onBottom);
@ -117,7 +114,7 @@ export default Vue.extend({
onNotification(notification) {
// TODO: ()
this.connection.send({
type: 'read_notification',
type: 'readNotification',
id: notification.id
});

View file

@ -36,18 +36,17 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
existMore: false,
connection: null,
connectionId: null
connection: null
};
},
computed: {
stream(): any {
switch (this.src) {
case 'home': return (this as any).os.stream;
case 'local': return (this as any).os.streams.localTimelineStream;
case 'hybrid': return (this as any).os.streams.hybridTimelineStream;
case 'global': return (this as any).os.streams.globalTimelineStream;
case 'home': return (this as any).os.stream.useSharedConnection('homeTimeline');
case 'local': return (this as any).os.stream.useSharedConnection('localTimeline');
case 'hybrid': return (this as any).os.stream.useSharedConnection('hybridTimeline');
case 'global': return (this as any).os.stream.useSharedConnection('globalTimeline');
}
},
@ -68,8 +67,7 @@ export default Vue.extend({
},
mounted() {
this.connection = this.stream.getConnection();
this.connectionId = this.stream.use();
this.connection = this.stream;
this.connection.on('note', this.onNote);
if (this.src == 'home') {
@ -81,12 +79,7 @@ export default Vue.extend({
},
beforeDestroy() {
this.connection.off('note', this.onNote);
if (this.src == 'home') {
this.connection.off('follow', this.onChangeFollowing);
this.connection.off('unfollow', this.onChangeFollowing);
}
this.stream.dispose(this.connectionId);
this.connection.dispose();
},
methods: {