StanzaJS Discussion - 2020-03-13

  1. marc0s hi, seems like getRoomMembers() is building the wrong IQ, `<item/>` is missing the `affiliation="member"` attribute. I'm trying to add it but can't get it right. This is what I did: ```diff --git a/src/protocol/xep0045.ts b/src/protocol/xep0045.ts index 082efa1..2fb1298 100644 --- a/src/protocol/xep0045.ts +++ b/src/protocol/xep0045.ts @@ -250,8 +250,8 @@ const Protocol: DefinitionOptions[] = [ }, { element: 'query', - fields: { - affiliation: attribute('affiliation', 'member'), + fields: { + affiliation: childAttribute(null, 'item', 'affiliation', 'member') }, namespace: NS_MUC_ADMIN, path: 'iq.muc', ```
  2. marc0s any help/hint would be really appreciated 🙂
  3. marc0s thanks!
  4. Lance i'll take a look into that today. thanks for reporting it!
  5. marc0s thanks Lance
  6. marc0s I tried to fix it myself, but not sure I figured it out correctly how to add an attribute to the jxt definitions 😕
  7. Lance you're calling getRoomMembers() without arguments, right?
  8. Lance getRoomMembers({ affiliation: 'member' }) should do the trick. i can make that be the default value if nothing is passed
  9. Lance not in jxt, but in the getRoomMembers method
  10. marc0s > you're calling getRoomMembers() without arguments, right? yes
  11. Lance ok, im going to change the default arg value to be { affiliation: 'member' }. that matches expectations instead of the {} i had in there
  12. Lance that method can query by either affiliation or role, not just affiliation=member
  13. marc0s nice, thanks 🙂
  14. Lance v12.6.2 should fix it marc0s
  15. marc0s thanks for the prompt response 🙂