Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
b527c875
Commit
b527c875
authored
Jul 31, 2021
by
Juliusz Chroboczek
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add chathistory message.
parent
97a5bf60
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
README.PROTOCOL
README.PROTOCOL
+4
-0
rtpconn/webclient.go
rtpconn/webclient.go
+1
-1
static/galene.js
static/galene.js
+5
-2
static/protocol.js
static/protocol.js
+4
-3
No files found.
README.PROTOCOL
View file @
b527c875
...
...
@@ -277,6 +277,10 @@ if the message was originated by a client with the `op` permission. The
field `noecho` is set by the client if it doesn't wish to receive a copy
of its own message.
The `chathistory` message is similar to the `chat` message, but carries
a message taken from the chat history. Most clients should treat
`chathistory` similarly to `chat`.
A user message is similar to a chat message, but is not conserved in the
chat history, and is not expected to contain user-visible content.
...
...
rtpconn/webclient.go
View file @
b527c875
...
...
@@ -1351,7 +1351,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
h
:=
c
.
group
.
GetChatHistory
()
for
_
,
m
:=
range
h
{
err
:=
c
.
write
(
clientMessage
{
Type
:
"chat"
,
Type
:
"chat
history
"
,
Id
:
m
.
Id
,
Username
:
m
.
User
,
Time
:
m
.
Time
,
...
...
static/galene.js
View file @
b527c875
...
...
@@ -2301,12 +2301,15 @@ let lastMessage = {};
/**
* @param {string} peerId
* @param {string} dest
* @param {string} nick
* @param {number} time
* @param {boolean} privileged
* @param {boolean} history
* @param {string} kind
* @param {unknown} message
*/
function
addToChatbox
(
peerId
,
dest
,
nick
,
time
,
privileged
,
kind
,
message
)
{
function
addToChatbox
(
peerId
,
dest
,
nick
,
time
,
privileged
,
history
,
kind
,
message
)
{
let
userpass
=
getUserPass
();
let
row
=
document
.
createElement
(
'
div
'
);
row
.
classList
.
add
(
'
message-row
'
);
...
...
@@ -2633,7 +2636,7 @@ commands.msg = {
throw
new
Error
(
`Unknown user
${
p
[
0
]}
`
);
serverConnection
.
chat
(
''
,
id
,
p
[
1
]);
addToChatbox
(
serverConnection
.
id
,
id
,
serverConnection
.
username
,
Date
.
now
(),
false
,
''
,
p
[
1
]);
Date
.
now
(),
false
,
false
,
''
,
p
[
1
]);
}
};
...
...
static/protocol.js
View file @
b527c875
...
...
@@ -178,7 +178,7 @@ function ServerConnection() {
/**
* onchat is called whenever a new chat message is received.
*
* @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, privileged: boolean, kind: string, message: unknown) => void}
* @type {(this: ServerConnection, id: string, dest: string, username: string, time: number, privileged: boolean,
history: boolean,
kind: string, message: unknown) => void}
*/
this
.
onchat
=
null
;
/**
...
...
@@ -379,10 +379,11 @@ ServerConnection.prototype.connect = async function(url) {
sc
.
onuser
.
call
(
sc
,
m
.
id
,
m
.
kind
);
break
;
case
'
chat
'
:
case
'
chathistory
'
:
if
(
sc
.
onchat
)
sc
.
onchat
.
call
(
sc
,
m
.
source
,
m
.
dest
,
m
.
username
,
m
.
time
,
m
.
privileged
,
m
.
kind
,
m
.
value
,
sc
,
m
.
source
,
m
.
dest
,
m
.
username
,
m
.
time
,
m
.
privileged
,
m
.
type
===
'
chathistory
'
,
m
.
kind
,
m
.
value
,
);
break
;
case
'
usermessage
'
:
...
...
Thomas Gambier
🚴🏼
@tomo
mentioned in commit
e99aa7d4
·
Oct 19, 2021
mentioned in commit
e99aa7d4
mentioned in commit e99aa7d498f12bf652ee731f8097b2c207460128
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment