- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.2k
feat: Polls using component. #2916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| * @param question | ||
| * @param answers | ||
| */ | ||
| createPoll(pollId: string, question: string, answers: Array<{ name: string; }>) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use an array of stringas at this level, rather than have to flatten it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we can put it as a type ... I will drop the flattened strings from everywhere so we can have a single strucutre as it now differs and depends on the operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot where we landed on this one, can you remind me pl?
7636744    to
    ad4f29b      
    Compare
  
            
          
                modules/xmpp/ChatRoom.ts
              
                Outdated
          
        
      | const msg = $msg({ to: targetJid, | ||
| type: 'chat' }); | ||
| // when not sending to a direct jid, let's indicate the room jid (used in polls) | ||
| const roomJid = useDirectJid ? this.roomjid : undefined; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Isn't the room JID already in the to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, we switched to sending messages to a component and the jid is missing there, it used to be the to of the messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we can get the target room with:
    -- get room name with tenant and find room
    local room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
In Prosody, like we do for breakout rooms, no?
| * @param question | ||
| * @param answers | ||
| */ | ||
| createPoll(pollId: string, question: string, answers: Array<{ name: string; }>) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot where we landed on this one, can you remind me pl?
| In the code where it is not voting, the answer is always in a structure with a name, greatly simplifies logic and types. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the need for passing the roomJid, LGTM otherwise.
        
          
                modules/xmpp/ChatRoom.ts
              
                Outdated
          
        
      | const msg = $msg({ to: targetJid, | ||
| type: 'chat' }); | ||
| // when not sending to a direct jid, let's indicate the room jid (used in polls) | ||
| const roomJid = useDirectJid ? this.roomjid : undefined; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we can get the target room with:
    -- get room name with tenant and find room
    local room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
In Prosody, like we do for breakout rooms, no?
2576f48    to
    d6efed3      
    Compare
  
    ba93426    to
    a7118f7      
    Compare
  
    
No description provided.