|
|
|
@ -1,33 +1,36 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="timeline">
|
|
|
|
|
<div class="timeGroup" v-for="timeGroup in splitArray(timeline,
|
|
|
|
|
obj => getDate(obj.event.origin_server_ts),obj => obj.event)" :key="timeGroup[0].origin_server_ts">
|
|
|
|
|
<div class="timeGroup"
|
|
|
|
|
v-for="timeGroup in splitArray(timeline,obj => getDate(obj.event.origin_server_ts),obj => obj.event)"
|
|
|
|
|
:key="timeGroup[0].origin_server_ts"
|
|
|
|
|
>
|
|
|
|
|
<div class="time">{{getDate(timeGroup[0].origin_server_ts)}}</div>
|
|
|
|
|
<div class="eventGroup" v-for="group in splitArray(timeGroup, obj => obj.sender)" :key="group[0].origin_server_ts">
|
|
|
|
|
<div class="thumbnailContainer">
|
|
|
|
|
<div class="filler"></div>
|
|
|
|
|
<userThumbnail v-if="group[0].sender !== user && groupTimeline"
|
|
|
|
|
:fallback="group[0].sender"
|
|
|
|
|
class="userThumbnail"
|
|
|
|
|
:mxcURL="getUser(group[0].sender).avatarUrl"
|
|
|
|
|
:size="2"
|
|
|
|
|
:title="group[0].sender"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="groupTimeline?'indent username':'username'"
|
|
|
|
|
v-if="group[0].sender !== user && groupTimeline">{{getUser(group[0].sender).displayName || group[0].sender}}
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="groupTimeline?'indent event':'event'"
|
|
|
|
|
v-for="event in group" :key="event.origin_server_ts"
|
|
|
|
|
:title="`${group[0].sender} at ${getTime(event.origin_server_ts)}`"
|
|
|
|
|
>
|
|
|
|
|
<message v-if="event.content.msgtype==='m.text'" :type="event.sender === user?'send':'receive'"
|
|
|
|
|
:group="false"
|
|
|
|
|
:msg=event.content.body :time=getTime(event.origin_server_ts)
|
|
|
|
|
/>
|
|
|
|
|
<div v-else-if="event.type==='m.room.member'" class="info">{{membershipEvents[event.content.membership]}}</div>
|
|
|
|
|
<div v-else class="info">unknown event</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="thumbnailContainer">
|
|
|
|
|
<div class="filler"></div>
|
|
|
|
|
<userThumbnail
|
|
|
|
|
v-if="group[0].sender !== user && groupTimeline"
|
|
|
|
|
:fallback="group[0].sender"
|
|
|
|
|
class="userThumbnail"
|
|
|
|
|
:mxcURL="getUser(group[0].sender).avatarUrl"
|
|
|
|
|
:size="2"
|
|
|
|
|
:title="group[0].sender"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="groupTimeline?'indent username':'username'"
|
|
|
|
|
v-if="group[0].sender !== user && groupTimeline">{{getUser(group[0].sender).displayName || group[0].sender}}
|
|
|
|
|
</div>
|
|
|
|
|
<div :class="groupTimeline?'indent event':'event'"
|
|
|
|
|
v-for="event in group" :key="event.origin_server_ts"
|
|
|
|
|
:title="`${group[0].sender} at ${getTime(event.origin_server_ts)}`"
|
|
|
|
|
>
|
|
|
|
|
<message v-if="event.content.msgtype==='m.text'"
|
|
|
|
|
:type="event.sender === user?'send':'receive'"
|
|
|
|
|
:msg=event.content.body :time=getTime(event.origin_server_ts)
|
|
|
|
|
/>
|
|
|
|
|
<div v-else-if="event.type==='m.room.member'" class="info">{{membershipEvents[event.content.membership]}}</div>
|
|
|
|
|
<div v-else class="info">unknown event</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|