Skip to content

Commit

Permalink
Fixed issue with row context method: isRowRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
sepehr committed Sep 14, 2020
1 parent e8ca358 commit d0fa601
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>lab.idioglossia</groupId>
<artifactId>springboot-row-starter</artifactId>
<version>1.3.2-RELEASE</version>
<version>1.3.3-RELEASE</version>
<name>Springboot Rest Over Websocket Starter</name>
<description>Spring boot starter for Rest Over Websocket</description>
<developers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

public class DefaultContextImpl implements RowContext {
private volatile RowUser rowUser;
private final boolean rowRequest;
private static final long serialVersionUID = 100L;

public DefaultContextImpl(RowUser rowUser) {
public DefaultContextImpl(RowUser rowUser, boolean isRowRequest) {
this.rowUser = rowUser;
this.rowRequest = isRowRequest;
}

@Override
public boolean isRowRequest() {
return true;
return this.rowRequest;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public void setContext(RowContext rowContext) {

@Override
public RowContext createEmptyContext() {
return new DefaultContextImpl(new RowUser());
return new DefaultContextImpl(new RowUser(), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void handle(RowWebsocketSession webSocketSession, TextMessage textMessage
private void fillContext(WebSocketSession webSocketSession) {
RowContextHolder.setContext(
new DefaultContextImpl(
new RowUser((String) webSocketSession.getAttributes().get(Naming.USER_ID_ATTRIBUTE_NAME), webSocketSession.getId())
new RowUser((String) webSocketSession.getAttributes().get(Naming.USER_ID_ATTRIBUTE_NAME), webSocketSession.getId()), true
)
);
}
Expand Down

0 comments on commit d0fa601

Please sign in to comment.