From 67bc24e7e283cba3aebd37f7282b9ee1f146d8c8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 28 Nov 2015 23:58:43 -0800 Subject: 2504 - support to-text in 'stash' --- 999spaces.cc | 1 + 1 file changed, 1 insertion(+) (limited to '999spaces.cc') diff --git a/999spaces.cc b/999spaces.cc index 1e85f908..2ab83f87 100644 --- a/999spaces.cc +++ b/999spaces.cc @@ -38,6 +38,7 @@ assert(Max_callstack_depth == 9989); //: 52 insert fragments //: ↳ 52.2 check fragments //: --- +//: 53 rewrite 'stash' instructions //: end instruction inserting transforms //: //: begin instruction modifying transforms -- cgit 1.4.1-2-gfad0 hod='get'> Profanity fork with TTY improvementsdanisanti <danisanti@tilde.institute>
about summary refs log tree commit diff stats
path: root/tests/functionaltests/test_receipts.c
blob: 59054ee893ef966ba403ec4006c4dfcb7ace6449 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <glib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>

#include <stabber.h>
#include <expect.h>

#include "proftest.h"

void
does_not_send_receipt_request_to_barejid(void **state)
{
    prof_input("/receipts request on");

    prof_connect();

    prof_input("/msg somejid@someserver.com Hi there");

    assert_true(stbbr_received(
        "<message id='*' type='chat' to='somejid@someserver.com'>"
            "<body>Hi there</body>"
        "</message>"
    ));
}

void
send_receipt_request(void **state)
{
    prof_input("/receipts request on");

    prof_connect();

    stbbr_for_id("prof_caps_4",
        "<iq from='buddy1@localhost/laptop' to='stabber@localhost' id='prof_caps_4' type='result'>"
            "<query xmlns='http://jabber.org/protocol/disco#info' node='http://profanity-im.github.io#hAkb1xZdJV9BQpgGNw8zG5Xsals='>"
                "<identity category='client' name='Profanity 0.5.0' type='console'/>"
                "<feature var='urn:xmpp:receipts'/>"
            "</query>"
        "</iq>"
    );

    stbbr_send(
        "<presence to='stabber@localhost' from='buddy1@localhost/laptop'>"
            "<priority>15</priority>"
            "<status>My status</status>"
            "<c hash='sha-256' xmlns='http://jabber.org/protocol/caps' node='http://profanity-im.github.io' ver='hAkb1xZdJV9BQpgGNw8zG5Xsals='/>"
        "</presence>"
    );

    prof_output_exact("Buddy1 is online, \"My status\"");

    prof_input("/msg Buddy1");
    prof_input("/resource set laptop");
    prof_input("Hi there, where is my receipt?");

    assert_true(stbbr_received(
        "<message id='*' type='chat' to='buddy1@localhost/laptop'>"
            "<body>Hi there, where is my receipt?</body>"
            "<request xmlns='urn:xmpp:receipts'/>"
        "</message>"
    ));
}

void
send_receipt_on_request(void **state)
{
    prof_input("/receipts send on");

    prof_connect();

    stbbr_send(
        "<message id='msg12213' type='chat' to='stabber@localhost/profanity' from='someuser@server.org/profanity'>"
            "<body>Wants a receipt</body>"
            "<request xmlns='urn:xmpp:receipts'/>"
        "</message>"
    );

    assert_true(stbbr_received(
        "<message id='*' to='someuser@server.org/profanity'>"
            "<received id='msg12213' xmlns='urn:xmpp:receipts'/>"
        "</message>"
    ));
}