Skip to content

Commit 125acb5

Browse files
committed
Return old subscribe method without headers
1 parent 4664650 commit 125acb5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/src/main/java/ua/naiksoftware/stomp/client/StompClient.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public void disconnect() {
147147
mConnected = false;
148148
}
149149

150+
public Observable<StompMessage> topic(String destinationPath) {
151+
return topic(destinationPath, null);
152+
}
153+
150154
public Observable<StompMessage> topic(String destinationPath, List<StompHeader> headerList) {
151155
return Observable.<StompMessage>create(subscriber -> {
152156
Set<Subscriber<? super StompMessage>> subscribersSet = mSubscribers.get(destinationPath);
@@ -183,9 +187,7 @@ private void subscribePath(String destinationPath, List<StompHeader> headerList)
183187
headers.add(new StompHeader(StompHeader.ID, topicId));
184188
headers.add(new StompHeader(StompHeader.DESTINATION, destinationPath));
185189
headers.add(new StompHeader(StompHeader.ACK, DEFAULT_ACK));
186-
for(StompHeader header : headerList){
187-
headers.add(header);
188-
}
190+
if (headerList != null) headers.addAll(headerList);
189191
send(new StompMessage(StompCommand.SUBSCRIBE,
190192
headers, null));
191193
}

0 commit comments

Comments
 (0)