-
-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add message-forwarding functionality
Adds a new action button to messages in the chat-history for message- forwarding. The Button opens a modal dialog where the user can enter a destination for the message. The destination can be a user in the roster or a MUC that is currently opened.
- Loading branch information
Showing
17 changed files
with
491 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,42 +11,6 @@ | |
|
||
describe("A Groupchat Message", function () { | ||
|
||
it("is rejected if it's an unencapsulated forwarded message", | ||
mock.initConverse( | ||
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, | ||
async function (done, _converse) { | ||
|
||
const muc_jid = '[email protected]'; | ||
await test_utils.openAndEnterChatRoom(_converse, muc_jid, 'romeo'); | ||
const impersonated_jid = `${muc_jid}/alice`; | ||
const received_stanza = u.toStanza(` | ||
<message to='${_converse.jid}' from='${muc_jid}/mallory' type='groupchat' id='${_converse.connection.getUniqueId()}'> | ||
<forwarded xmlns='urn:xmpp:forward:0'> | ||
<delay xmlns='urn:xmpp:delay' stamp='2019-07-10T23:08:25Z'/> | ||
<message from='${impersonated_jid}' | ||
id='0202197' | ||
to='${_converse.bare_jid}' | ||
type='groupchat' | ||
xmlns='jabber:client'> | ||
<body>Yet I should kill thee with much cherishing.</body> | ||
</message> | ||
</forwarded> | ||
</message> | ||
`); | ||
const view = _converse.api.chatviews.get(muc_jid); | ||
await view.model.onMessage(received_stanza); | ||
spyOn(_converse, 'log'); | ||
_converse.connection._dataRecv(test_utils.createRequest(received_stanza)); | ||
expect(_converse.log).toHaveBeenCalledWith( | ||
'onMessage: Ignoring unencapsulated forwarded groupchat message', | ||
Strophe.LogLevel.WARN | ||
); | ||
expect(view.el.querySelectorAll('.chat-msg').length).toBe(0); | ||
expect(view.model.messages.length).toBe(0); | ||
done(); | ||
})); | ||
|
||
|
||
it("is specially marked when you are mentioned in it", | ||
mock.initConverse( | ||
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.