@@ -114,14 +114,14 @@ export function creatorAndDateHorizontal (td1, creator, date, message) {
114114/**
115115 * Renders a chat message, read-only mode
116116 */
117- export function renderMessageRow ( channelObject , bindings , fresh , options , userContext ) {
117+ export function renderMessageRow ( channelObject , message , fresh , options , userContext ) {
118118 const colorizeByAuthor =
119119 options . colorizeByAuthor === '1' || options . colorizeByAuthor === true
120120
121- const creator = bindings [ '?creator' ]
122- const message = bindings [ '?msg' ]
123- const date = bindings [ '?date' ]
124- const content = bindings [ '? content']
121+ const creator = store . any ( message , ns . foaf ( 'maker' ) )
122+ const date = store . any ( message , ns . dct ( 'created' ) )
123+ const latestVersion = mostRecentVersion ( message )
124+ const content = store . any ( latestVersion , ns . sioc ( ' content') )
125125
126126 const originalMessage = originalVersion ( message )
127127 const edited = ! message . sameTerm ( originalMessage )
@@ -260,16 +260,10 @@ export function renderMessageEditor (channelObject, messageTable, userContext, o
260260 }
261261
262262 async function sendMessage ( text , fromMainField ) {
263- function sendComplete ( message , text2 ) {
264- const dateStamp = store . any ( message , ns . dct ( 'created' ) , null , message . doc ( ) )
265- const content = $rdf . literal ( text2 )
266- const bindings = {
267- '?msg' : message ,
268- '?content' : content ,
269- '?date' : dateStamp ,
270- '?creator' : me
271- }
272- insertMessageIntoTable ( channelObject , messageTable , bindings , false , options , userContext ) // not green
263+ function sendComplete ( message , _text2 ) {
264+ // const dateStamp = store.any(message, ns.dct('created'), null, message.doc())
265+ // const content = $rdf.literal(text2)
266+ insertMessageIntoTable ( channelObject , messageTable , message , false , options , userContext ) // not green
273267
274268 if ( originalMessage ) { // editing another message
275269 const oldRow = messageEditor . originalRow
@@ -295,7 +289,7 @@ export function renderMessageEditor (channelObject, messageTable, userContext, o
295289 // await channelObject.div.refresh() // Add new day if nec @@ add back
296290 }
297291
298- const me = authn . currentUser ( ) // Must be logged on or wuld have got login button
292+ // const me = authn.currentUser() // Must be logged on or wuld have got login button
299293 if ( fromMainField ) {
300294 field . setAttribute ( 'style' , messageBodyStyle + 'color: #bbb;' ) // pendingedit
301295 field . disabled = true
0 commit comments