!jiRZORhJXxYobcAysp:matrix.org

Matrix JS SDK

37 Members
Unofficial discussion for the Matrix JS SDK library | https://github.com/matrix-org/matrix-js-sdk14 Servers

Load older messages


SenderMessageTime
24 Mar 2021
@jrlmontejo:matrix.orgjrlmontejo joined the room.06:50:43
@jrlmontejo:matrix.orgjrlmontejo hello! anyone had any luck making matrix-js-sdk work with Vitejs instead of webpack? 06:51:19
@jrlmontejo:matrix.orgjrlmontejo

I tried running

import * as sdk from 'matrix-js-sdk'

const client = sdk.createClient('https://matrix.org')
06:55:42
@jrlmontejo:matrix.orgjrlmontejo console displays Uncaught SyntaxError: Invalid or unexpected token 06:55:55
@jrlmontejo:matrix.orgjrlmontejoThere are no errors when webpack/vue-cli is used instead of Vite07:06:19
15 Apr 2021
@ali_jafari:matrix.orgAli Jafari joined the room.09:57:39
18 Apr 2021
@hanno_jg:matrix.orghanno_jg joined the room.14:12:03
@hanno_jg:matrix.orghanno_jghey, do we have a function to find out whether a room is a direct room?14:12:23
@manishoo:matrix.orgMani Shooshtari hanno_jg: I'm not sure if the JS sdk has this but there's a class in the react sdk called DMRoomMap that u can use like this: const isDm = DMRoomMap.shared().getUserIdForRoomId(room.roomId);. Check that out 14:17:30
@manishoo:matrix.orgMani Shooshtari * hanno_jg: I'm not sure if the JS sdk has this but there's a class in the react sdk called DMRoomMap that u can use like this: const isDm = DMRoomMap.shared().getUserIdForRoomId(room.roomId);. Check that out 14:18:52
@hanno_jg:matrix.orghanno_jgthx14:19:19
@freaktechnik:humanoids.befreaktechnikthat's essentially the m.direct account data, most likely.14:20:15
@hanno_jg:matrix.orghanno_jgyeah, but strangely the room doesn't have any m.direct events 🤔14:23:40
@freaktechnik:humanoids.befreaktechnikm.direct isn't an event in the room, it's in the account data15:10:50
@freaktechnik:humanoids.befreaktechnik
client.on("accountData", event => {
      if (event.getType() == "m.direct") {
15:11:37
@freaktechnik:humanoids.befreaktechnik *
client.on("accountData", event => {
      if (event.getType() == "m.direct") {
15:11:57
@freaktechnik:humanoids.befreaktechnik(not sure if there's a way to read the account data directly, there probably is)15:14:32
@freaktechnik:humanoids.befreaktechnik * (not sure if there's a way to read the account data directly, there probably is)15:14:36
@absolutezoned:matrix.orgabsolutezonedIn other words, you can trick Matrix into thinking any room is a direct message or not.15:34:31
@hanno_jg:matrix.orghanno_jgyeah, checked that too, seems like the matrix-js-sdk doesn't load these kind of data or it didn't get stored properly. The users accountData also have no "m.direct" field, very strange17:30:08
29 Apr 2021
@jrlmontejo:matrix.orgjrlmontejohello! is there a way to check if the logged in user is a new user? right now, I'm only using `client.getJoinedRooms()` and checking if it's empty.07:17:34
@jrlmontejo:matrix.orgjrlmontejo* hello! is there a way to check if the logged in user is a new user? right now, I'm only using `client.getJoinedRooms()` and checking if it's empty.07:51:44
@freaktechnik:humanoids.befreaktechnikwhat do you mean by new?09:48:30
3 May 2021
@ali_jafari:matrix.orgAli Jafari changed their display name from Ali Jafari - Matrix to Ali Jafari.13:56:36
6 May 2021
@yisusflores:matrix.orgyisusflores joined the room.21:03:12
@yisusflores:matrix.orgyisusfloresIs it possible to deactivate a user if he exceeds a number of login attempts? or how to limit the constant login attempt?21:03:50
@yisusflores:matrix.orgyisusfloresor some kind of temporary account lock? in the matrix-js-sdk project there is a function called MatrixScheduler.RETRY_BACKOFF_RATELIMIT has to do with the execution of an event (* Retries events up to 4 times using exponential backoff. This produces wait times of 2, 4, 8, and 16 seconds (30s total) after which we give up. If the failure was due to a rate limited request, the time specified in the error is waited before being retried.) How could something be done to prevent a user from insisting on trying to log in more than the allowed number of times?21:04:04
7 May 2021
@server_stats:nordgedanken.devServer Stats Discoverer (traveler bot) joined the room.15:57:17
@server_stats:nordgedanken.devServer Stats Discoverer (traveler bot) 15:57:19
11 May 2021
@server_stats:nordgedanken.devServer Stats Discoverer (traveler bot) set a profile picture.12:38:03

There are no newer messages yet.


Back to Room List