From c8832bee918f82cb58fc7cf097a0c2cc9fe491bf Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sat, 9 Jul 2011 21:32:56 +0200 Subject: [PATCH] Auto-confirm subscription requests --- src/mpdbot.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mpdbot.m b/src/mpdbot.m index f55e4b7..1c7ab7d 100644 --- a/src/mpdbot.m +++ b/src/mpdbot.m @@ -129,7 +129,13 @@ OF_APPLICATION_DELEGATE(AppDelegate) - (void)connection: (XMPPConnection*)conn didReceivePresence: (XMPPPresence*)pres { - of_log(@"Presence: %@", pres); + if ([pres.type isEqual: @"subscribe"]) { + XMPPPresence *answer; + answer = [XMPPPresence presenceWithType: @"subscribed" + ID: pres.ID]; + answer.to = [XMPPJID JIDWithString: [pres.from bareJID]]; + [conn sendStanza: answer]; + } } - (void)connectionWasClosed: (XMPPConnection*)conn -- 2.39.2