Kaynağa Gözat

Render URLs in the topic in the room details modal

JC Brand 7 yıl önce
ebeveyn
işleme
a67fa6d4e5

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
dist/converse.js


+ 3 - 0
src/converse-muc-views.js

@@ -8,6 +8,7 @@
     define([
         "converse-core",
         "utils/muc",
+        "xss",
         "templates/add_chatroom_modal.html",
         "templates/chatarea.html",
         "templates/chatroom.html",
@@ -35,6 +36,7 @@
 }(this, function (
     converse,
     muc_utils,
+    xss,
     tpl_add_chatroom_modal,
     tpl_chatarea,
     tpl_chatroom,
@@ -495,6 +497,7 @@
                         this.model.toJSON(), {
                             '_': _,
                             '__': __,
+                            'topic': u.addHyperlinks(xss.filterXSS(_.get(this.model.get('subject'), 'text'), {'whiteList': {}})),
                             'display_name': __('Groupchat info for %1$s', this.model.getDisplayName()),
                             'num_occupants': this.model.occupants.length
                         })

+ 1 - 1
src/templates/chatroom_details_modal.html

@@ -11,7 +11,7 @@
                     <p class="room-info"><strong>{{{o.__('Room address (JID)')}}}</strong>: {{{o.jid}}}</p>
                     <p class="room-info"><strong>{{{o.__('Description')}}}</strong>: {{{o.description}}}</p>
                     {[ if (o.subject) { ]}
-                        <p class="room-info"><strong>{{{o.__('Topic')}}}</strong>: {{{o._.get(o.subject, 'text')}}}</p>
+                    <p class="room-info"><strong>{{{o.__('Topic')}}}</strong>: {{o.topic}}</p> <!-- Sanitized in converse-muc-views. We want to render links. -->
                         <p class="room-info"><strong>{{{o.__('Topic author')}}}</strong>: {{{o._.get(o.subject, 'author')}}}</p>
                     {[ } ]}
                     <p class="room-info"><strong>{{{o.__('Online users')}}}</strong>: {{{o.num_occupants}}}</p>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor