about summary refs log tree commit diff stats
path: root/src/event/server_events.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-08-01 20:48:23 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-08-01 20:48:23 +0200
commit53c31159769296a9797da6653bc070b9467f3c08 (patch)
tree67087393bbd4264da3ecd01db3c52247555fb51b /src/event/server_events.c
parentd4150eb7d15c3a8674eaf78a212209381ed95ee9 (diff)
downloadprofani-tty-53c31159769296a9797da6653bc070b9467f3c08.tar.gz
Don't print subscribed message if contact is already in roster
This occured with a user running Cisco Jabber. It seems this server
sends repeated presence subscribed stanzas. And although I find this
strange according to RFC this seems to be ok.

So let's filter them and only display in the console output and to the
log. But don't open seperate windows.

Fix https://github.com/profanity-im/profanity/issues/1165
Diffstat (limited to 'src/event/server_events.c')
-rw-r--r--src/event/server_events.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index 86a9ae8d..14c0a11a 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -863,9 +863,13 @@ sv_ev_subscription(const char *barejid, jabber_subscr_t type)
         }
         break;
     case PRESENCE_SUBSCRIBED:
-        cons_show("Subscription received from %s", barejid);
         log_info("Subscription received from %s", barejid);
-        ui_print_system_msg_from_recipient(barejid, "Subscribed");
+        cons_show("Subscription received from %s", barejid);
+
+        PContact contact = roster_get_contact(barejid);
+        if (contact == NULL) {
+            ui_print_system_msg_from_recipient(barejid, "Subscribed");
+        }
         break;
     case PRESENCE_UNSUBSCRIBED:
         cons_show("%s deleted subscription", barejid);
bx/020elf.cc?h=hlt&id=66cd241ebcf6ba072c2a54bbf6894acff42bc799'>^
7df0ea4e ^

1d5d645b ^
708eae31 ^

f1b3d7b9 ^
708eae31 ^
414d9413 ^
708eae31 ^


414d9413 ^
708eae31 ^
414d9413 ^
f1b3d7b9 ^
708eae31 ^


f1b3d7b9 ^
708eae31 ^

96b2216b ^
414d9413 ^
96b2216b ^
414d9413 ^
96b2216b ^
414d9413 ^
96b2216b ^


414d9413 ^
96b2216b ^
708eae31 ^

96b2216b ^


414d9413 ^
96b2216b ^

fd7198b2 ^
96b2216b ^


708eae31 ^
9527eda9 ^
96b2216b ^
9527eda9 ^
708eae31 ^
6602c82f ^
9527eda9 ^
630433cd ^
9527eda9 ^
a1305217 ^
6602c82f ^

708eae31 ^
f1b3d7b9 ^


a413105a ^
630433cd ^
f1b3d7b9 ^
a413105a ^
a413105a ^
f1b3d7b9 ^
9527eda9 ^
f1b3d7b9 ^

4a99a6e0 ^
f1b3d7b9 ^

a413105a ^
f1b3d7b9 ^



6362c51d ^



9ad81331 ^
6362c51d ^
c442a5ad ^

f1b3d7b9 ^
708eae31 ^

9527eda9 ^
96b2216b ^
fd7198b2 ^
96b2216b ^
fd7198b2 ^
96b2216b ^



414d9413 ^
96b2216b ^



630433cd ^
96b2216b ^

414d9413 ^
4a99a6e0 ^

630433cd ^

fd7198b2 ^
630433cd ^

9527eda9 ^

665a4d70 ^
9527eda9 ^

630433cd ^
96b2216b ^


1f4d0aaf ^
fbc21293 ^
44fdc79f ^






6f6d458f ^




c88b9e31 ^

e5998f74 ^

1f4d0aaf ^
e0a0484c ^
e5998f74 ^
c442a5ad ^
e0a0484c ^
7a22a219 ^

e0a0484c ^
7a22a219 ^
e0a0484c ^

708eae31 ^



96b2216b ^



414d9413 ^


1a33d221 ^
708eae31 ^
cd23c8b6 ^
414d9413 ^


2097401c ^
708eae31 ^


708eae31 ^
087a998e ^
a066ad7e ^
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193