Skip to content

Commit

Permalink
Private groups - queueWatch WebSocket, small fix (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Dec 13, 2024
1 parent 6569c41 commit 1dd3b18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/modules/MessagesTopCenter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
@media screen and (max-width: 39.9375em) {
.GroupDropdown {
left: 10px !important;
position: fixed;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/components/pages/Messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { getProfileImage, } from 'app/utils/NormalizeProfile';
import { normalizeContacts, normalizeMessages, cacheMyOwnMsg } from 'app/utils/Normalizators';
import { fitToPreview } from 'app/utils/ImageUtils';
import { notificationSubscribe, notificationSubscribeWs, notifyWsPing,
notificationShallowUnsubscribe, notificationTake, queueWatch, sendOffchainMessage, notifyWsHost, notifyUrl } from 'app/utils/NotifyApiClient';
notificationShallowUnsubscribe, notificationTake, queueWatchWs, sendOffchainMessage, notifyWsHost, notifyUrl } from 'app/utils/NotifyApiClient';
import { flash, unflash } from 'app/components/elements/messages/FlashTitle';
import { addShortcut } from 'app/utils/app/ShortcutUtils'
import { hideSplash } from 'app/utils/app/SplashUtils'
Expand Down Expand Up @@ -252,17 +252,17 @@ class Messages extends React.Component {

const {username} = this.props
if (!username) {
console.log('watchGroup -', to, ' - no username')
console.log('watchGroupWs -', to, ' - no username')
return false
}
try {
window.errorLogs.push({ details: { watchGroup: to } })
await queueWatch(username, to)
console.log('watchGroup - ', to)
await queueWatchWs(username, to)
console.log('watchGroupWs - ', to)
window.errorLogs.push({ details: { watchGroup: 'ok' } })
return true
} catch (err) {
console.error('watchGroup - ', to, err)
console.error('watchGroupWs - ', to, err)
this.notifyErrorsInc(30, err, {watchGroup: notifyUrl()})
}
return false
Expand Down
3 changes: 2 additions & 1 deletion src/utils/NotifyApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ export async function queueWatchWs(account, group, sidKey = '__subscriber_id') {
if (!notifyWsHost()) return null
const xSession = notifySession()
return await new Promise(async (resolve, reject) => {
await notifyWsSend('queues/subscribe', {
await notifyWsSend('queues/watch', {
account,
'X-Session': xSession,
subscriber_id: window[sidKey],
objects: {
[group]: {
type: 'group',
Expand Down

0 comments on commit 1dd3b18

Please sign in to comment.