littleredbutton / bigbluebutton-api-php

Unofficial (but better) PHP API for @BigBlueButton
GNU Lesser General Public License v3.0
25 stars 12 forks source link

Fix get meetings fail scalelite #62

Closed SamuelWei closed 3 years ago

SamuelWei commented 3 years ago

Fixes #61 by checking if 'getMeetings' response has 'noMeetings' 'messageKey' before extracting the meetings from the response

sualko commented 3 years ago
  1. I think it's a good thing to handle that case
  2. Do we need to rely on the key? I would prefer to check the xml for that element.
  3. Can you use typed comparison?

Btw at the prototype fund there is a project which tries to create an alternative for scalelite: https://prototypefund.de/project/b3scale/

SamuelWei commented 3 years ago

@sualko Thanks for your quick feedback!

Would you prefer that?

if ( $this->getMessageKey() !== 'noMeetings' && isset($this->rawXml->meetings)) {
  foreach ($this->rawXml->meetings->children() as $meetingXml) {
    $this->meetings[] = new Meeting($meetingXml);
  }
}

I have heard about b3scale, but haven't used it yet. I know that h_da is also building a scalelite/greenlight alternative bbb@scale (django) and we at THM are building a scalelite/greenlight alternative as well https://github.com/THM-Health/PILOS (laravel/vue js). As an other department used scalelite I wanted to add it but noticed this error.

sualko commented 3 years ago

Would you prefer that?

From my point of view it's not important to check the message key at all. If there are children, than we should show them to the user and if not, than not. But yea that's better, at least for me.