Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 191... Línea 191...
191
            iscontact: null,
191
            iscontact: null,
192
            isdeleted: null,
192
            isdeleted: null,
193
            canmessage: null,
193
            canmessage: null,
194
            canmessageevenifblocked: null,
194
            canmessageevenifblocked: null,
195
            requirescontact: null,
195
            requirescontact: null,
196
            contactrequests: []
196
            contactrequests: [],
-
 
197
            cancreatecontact: null,
197
        };
198
        };
198
    };
199
    };
Línea 199... Línea 200...
199
 
200
 
200
    /**
201
    /**
Línea 1334... Línea 1335...
1334
            text: text,
1335
            text: text,
1335
            timecreated: null
1336
            timecreated: null
1336
        };
1337
        };
1337
        sendMessageBuffer.push(message);
1338
        sendMessageBuffer.push(message);
1338
        processSendMessageBuffer();
1339
        processSendMessageBuffer();
-
 
1340
 
-
 
1341
        // Remove the unsent message attribute so we can be notified of new unsent messages (see storeUnsentMessage).
-
 
1342
        const textArea = document.querySelector(SELECTORS.MESSAGE_TEXT_AREA);
-
 
1343
        if (textArea) {
-
 
1344
            textArea.removeAttribute('data-unsent-message-viewed');
-
 
1345
        }
1339
    };
1346
    };
Línea 1340... Línea 1347...
1340
 
1347
 
1341
    /**
1348
    /**
1342
     * Retry sending a message that failed.
1349
     * Retry sending a message that failed.
Línea 2117... Línea 2124...
2117
            // If we didn't get a conversation id got a user id then let's see if we've
2124
            // If we didn't get a conversation id got a user id then let's see if we've
2118
            // previously loaded a private conversation with this user.
2125
            // previously loaded a private conversation with this user.
2119
            conversationId = getCachedPrivateConversationIdFromUserId(otherUserId);
2126
            conversationId = getCachedPrivateConversationIdFromUserId(otherUserId);
2120
        }
2127
        }
Línea -... Línea 2128...
-
 
2128
 
-
 
2129
        // Set attributes to aid in the restoration of unsent messages.
-
 
2130
        setConversationAttributes(footer, conversationId, otherUserId);
2121
 
2131
 
2122
        // This is a new conversation if:
2132
        // This is a new conversation if:
2123
        // 1. We don't already have a state
2133
        // 1. We don't already have a state
2124
        // 2. The given conversation doesn't match the one currently loaded
2134
        // 2. The given conversation doesn't match the one currently loaded
2125
        // 3. We have a view state without a conversation id and we weren't given one
2135
        // 3. We have a view state without a conversation id and we weren't given one
Línea 2194... Línea 2204...
2194
     */
2204
     */
2195
    var description = function() {
2205
    var description = function() {
2196
        return Str.get_string('messagedrawerviewconversation', 'core_message', viewState.name);
2206
        return Str.get_string('messagedrawerviewconversation', 'core_message', viewState.name);
2197
    };
2207
    };
Línea -... Línea 2208...
-
 
2208
 
-
 
2209
    /**
-
 
2210
     * Set some attributes that will help reboot a conversation.
-
 
2211
     *
-
 
2212
     * These attributes aid in the storage and retrieval of unsent messages.
-
 
2213
     * When a conversationid is not present, otheruserid can be used to create a conversation.
-
 
2214
     *
-
 
2215
     * @param {Object} element The element to target.
-
 
2216
     * @param {Number|null} conversationId The conversationid.
-
 
2217
     * @param {Number|null} otherUserId The otheruserid.
-
 
2218
     */
-
 
2219
    const setConversationAttributes = function(element, conversationId, otherUserId) {
-
 
2220
        element.removeAttr('data-conversation-id');
-
 
2221
        element.removeAttr('data-other-user-id');
-
 
2222
        if (conversationId) {
-
 
2223
            element.attr('data-conversation-id', conversationId);
-
 
2224
        } else if (otherUserId) {
-
 
2225
            element.attr('data-other-user-id', otherUserId);
-
 
2226
        }
-
 
2227
    };
2198
 
2228
 
2199
    return {
2229
    return {
2200
        show: show,
2230
        show: show,
2201
        description: description
2231
        description: description
2202
    };
2232
    };