Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
874
Issues
874
List
Boards
Labels
Service Desk
Milestones
Merge Requests
44
Merge Requests
44
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
2ab805d7b39ad4bfc9fb3a85713957d9b1ffb340...2627ae77a1b464c46a9c49efab8799d58713345c
Source
2627ae77a1b464c46a9c49efab8799d58713345c
Select Git revision
...
Target
2ab805d7b39ad4bfc9fb3a85713957d9b1ffb340
Select Git revision
Compare
Commits (2)
(feat): enforce message permission flag
· b4e83ad9
Marcelo Rivera
authored
2 hours ago
b4e83ad9
(feat): enforce JOIN permission flag on groups
· 2627ae77
Marcelo Rivera
authored
2 hours ago
2627ae77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
src/app/modules/groups/groups-join-button.ts
src/app/modules/groups/groups-join-button.ts
+14
-1
src/app/modules/messenger/conversation/conversation.component.ts
.../modules/messenger/conversation/conversation.component.ts
+20
-6
No files found.
src/app/modules/groups/groups-join-button.ts
View file @
2627ae77
...
...
@@ -4,6 +4,9 @@ import { Router } from '@angular/router';
import
{
GroupsService
}
from
'
./groups-service
'
;
import
{
Session
}
from
'
../../services/session
'
;
import
{
LoginReferrerService
}
from
'
../../services/login-referrer.service
'
;
import
{
PermissionsService
}
from
'
../../common/services/permissions/permissions.service
'
;
import
{
FeaturesService
}
from
'
../../services/features.service
'
;
import
{
Flags
}
from
'
../../common/services/permissions/flags
'
;
@
Component
({
selector
:
'
minds-groups-join-button
'
,
...
...
@@ -79,7 +82,9 @@ export class GroupsJoinButton {
public
session
:
Session
,
public
service
:
GroupsService
,
private
router
:
Router
,
private
loginReferrer
:
LoginReferrerService
private
loginReferrer
:
LoginReferrerService
,
private
featuresService
:
FeaturesService
,
private
permissionsService
:
PermissionsService
)
{
this
.
minds
=
window
.
Minds
;
}
...
...
@@ -116,6 +121,14 @@ export class GroupsJoinButton {
this
.
router
.
navigate
([
'
/login
'
]);
return
;
}
if
(
this
.
featuresService
.
has
(
'
permissions
'
)
&&
!
this
.
permissionsService
.
canInteract
(
this
.
group
,
Flags
.
JOIN
)
)
{
return
;
}
this
.
inProgress
=
true
;
this
.
service
.
join
(
this
.
group
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/messenger/conversation/conversation.component.ts
View file @
2627ae77
...
...
@@ -6,6 +6,8 @@ import {
Renderer
,
ViewChild
,
Injector
,
OnInit
,
OnDestroy
,
}
from
'
@angular/core
'
;
import
{
Client
}
from
'
../../../services/api
'
;
...
...
@@ -18,6 +20,9 @@ import { MessengerEncryptionService } from '../encryption/encryption.service';
import
{
MessengerConversationDockpanesService
}
from
'
../dockpanes/dockpanes.service
'
;
import
{
MessengerSounds
}
from
'
../sounds/service
'
;
import
{
BlockListService
}
from
'
../../../common/services/block-list.service
'
;
import
{
FeaturesService
}
from
'
../../../services/features.service
'
;
import
{
PermissionsService
}
from
'
../../../common/services/permissions/permissions.service
'
;
import
{
Flags
}
from
'
../../../common/services/permissions/flags
'
;
@
Component
({
moduleId
:
module
.
id
,
...
...
@@ -29,7 +34,7 @@ import { BlockListService } from '../../../common/services/block-list.service';
inputs
:
[
'
conversation
'
],
templateUrl
:
'
conversation.component.html
'
,
})
export
class
MessengerConversation
{
export
class
MessengerConversation
implements
OnInit
,
OnDestroy
{
minds
:
Minds
=
window
.
Minds
;
sounds
=
new
MessengerSounds
();
...
...
@@ -81,7 +86,9 @@ export class MessengerConversation {
private
renderer
:
Renderer
,
public
encryption
:
MessengerEncryptionService
,
public
dockpanes
:
MessengerConversationDockpanesService
,
protected
blockListService
:
BlockListService
protected
blockListService
:
BlockListService
,
protected
featuresService
:
FeaturesService
,
protected
permissionsService
:
PermissionsService
)
{
this
.
buildTabId
();
}
...
...
@@ -130,8 +137,8 @@ export class MessengerConversation {
this
.
messages
=
this
.
messages
.
concat
(
response
.
messages
);
this
.
scrollEmitter
.
next
(
true
);
}
else
if
(
opts
.
offset
)
{
le
t
scrollTop
=
scrollView
.
scrollTop
;
le
t
scrollHeight
=
scrollView
.
scrollHeight
;
cons
t
scrollTop
=
scrollView
.
scrollTop
;
cons
t
scrollHeight
=
scrollView
.
scrollHeight
;
if
(
this
.
messages
.
length
)
{
response
.
messages
.
pop
();
}
...
...
@@ -249,6 +256,13 @@ export class MessengerConversation {
send
(
e
)
{
e
.
preventDefault
();
if
(
this
.
featuresService
.
has
(
'
permissions
'
)
&&
!
this
.
permissionsService
.
canInteract
(
this
.
conversation
,
Flags
.
MESSAGE
)
)
{
return
;
}
if
(
this
.
blocked
||
!
this
.
message
||
...
...
@@ -258,7 +272,7 @@ export class MessengerConversation {
return
;
}
le
t
newLength
=
this
.
messages
.
push
({
cons
t
newLength
=
this
.
messages
.
push
({
// Optimistic
optimisticGuess
:
true
,
owner
:
this
.
session
.
getLoggedInUser
(),
...
...
@@ -332,7 +346,7 @@ export class MessengerConversation {
this
.
blockingActionInProgress
=
true
;
le
t
blocks
=
[],
cons
t
blocks
=
[],
newState
=
!
this
.
blocked
;
this
.
conversation
.
participants
.
forEach
((
participant
:
any
)
=>
{
...
...
This diff is collapsed.
Click to expand it.