X-Git-Url: http://cgit.babelmonkeys.de/?p=mpdbot.git;a=blobdiff_plain;f=src%2Fmpdbot.m;h=1c7ab7d4ac18cdcee606e4230ada7da49953cd92;hp=f55e4b77ec3b23f6cd8e7130b46cba15a8bab010;hb=c8832bee918f82cb58fc7cf097a0c2cc9fe491bf;hpb=8b1ed6e03e1bc6a261db3b965d29f9b47fb116af 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