Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
skylivex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
astronomy
skylivex
Commits
e23c7d37
Commit
e23c7d37
authored
Apr 08, 2013
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update userlist backend methods
parent
bd7ecd37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
jsbridge.h
src/jsbridge.h
+2
-0
webwin.cpp
src/webwin.cpp
+32
-0
webwin.h
src/webwin.h
+1
-0
No files found.
src/jsbridge.h
View file @
e23c7d37
...
@@ -62,6 +62,8 @@ class JSBridge : public QObject
...
@@ -62,6 +62,8 @@ class JSBridge : public QObject
void
notify
(
QString
content
);
void
notify
(
QString
content
);
void
alertmsg
(
QString
content
);
void
alertmsg
(
QString
content
);
void
public_received
(
QString
user
,
QString
content
);
void
public_received
(
QString
user
,
QString
content
);
void
updateUserList
(
QString
user
,
QString
utype
,
QString
direction
);
void
deleteUserList
();
public
slots
:
public
slots
:
void
pushLogin
(
QString
username
,
QString
password
);
void
pushLogin
(
QString
username
,
QString
password
);
...
...
src/webwin.cpp
View file @
e23c7d37
...
@@ -272,6 +272,7 @@ SkylivexWin::SkylivexWin(QString &htmlfile)
...
@@ -272,6 +272,7 @@ SkylivexWin::SkylivexWin(QString &htmlfile)
registerHandler
((
QString
)
"alert"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_alert
);
registerHandler
((
QString
)
"alert"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_alert
);
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
registerHandler
((
QString
)
"userlist"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_userlist
);
}
}
...
@@ -288,6 +289,7 @@ SkylivexWin::SkylivexWin()
...
@@ -288,6 +289,7 @@ SkylivexWin::SkylivexWin()
registerHandler
((
QString
)
"alert"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_alert
);
registerHandler
((
QString
)
"alert"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_alert
);
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"notify"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_notify
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
registerHandler
((
QString
)
"publicchatrcv"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_chatreceived
);
registerHandler
((
QString
)
"userlist"
,
(
SKHandlerFunction
)
&
SkylivexWin
::
handle_userlist
);
}
}
...
@@ -371,3 +373,33 @@ void SkylivexWin::handle_chatreceived(SKMessage &msg)
...
@@ -371,3 +373,33 @@ void SkylivexWin::handle_chatreceived(SKMessage &msg)
}
}
}
}
void
SkylivexWin
::
handle_userlist
(
SKMessage
&
msg
)
{
if
(
msg
.
handle
==
"userlist"
)
{
if
(
msg
.
parameters
.
contains
(
"type"
))
{
if
(
msg
.
parameters
[
"type"
]
==
"all"
)
{
jsbridge
->
deleteUserList
();
for
(
int
i
=
0
;
i
<
msg
.
listparams
[
"admins"
].
size
();
i
++
)
{
jsbridge
->
updateUserList
(
msg
.
listparams
[
"admins"
][
i
],
"admin"
,
"in"
);
}
for
(
int
i
=
0
;
i
<
msg
.
listparams
[
"enableds"
].
size
();
i
++
)
{
jsbridge
->
updateUserList
(
msg
.
listparams
[
"enableds"
][
i
],
"enabled"
,
"in"
);
}
for
(
int
i
=
0
;
i
<
msg
.
listparams
[
"users"
].
size
();
i
++
)
{
jsbridge
->
updateUserList
(
msg
.
listparams
[
"users"
][
i
],
"user"
,
"in"
);
}
}
else
if
(
msg
.
parameters
[
"type"
]
==
"in"
||
msg
.
parameters
[
"type"
]
==
"out"
)
{
jsbridge
->
updateUserList
(
msg
.
parameters
[
"user"
],
msg
.
parameters
[
"usertype"
],
msg
.
parameters
[
"type"
]);
}
}
}
}
src/webwin.h
View file @
e23c7d37
...
@@ -131,6 +131,7 @@ class SkylivexWin : public WebWin
...
@@ -131,6 +131,7 @@ class SkylivexWin : public WebWin
void
handle_alert
(
SKMessage
&
msg
);
void
handle_alert
(
SKMessage
&
msg
);
void
handle_notify
(
SKMessage
&
msg
);
void
handle_notify
(
SKMessage
&
msg
);
void
handle_chatreceived
(
SKMessage
&
msg
);
void
handle_chatreceived
(
SKMessage
&
msg
);
void
handle_userlist
(
SKMessage
&
msg
);
private
slots
:
private
slots
:
void
refreshJsObject
();
void
refreshJsObject
();
...
...
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