diff --git a/src/XMPP/MUC.c b/src/XMPP/MUC.c index 498ddfa..5d39d78 100644 --- a/src/XMPP/MUC.c +++ b/src/XMPP/MUC.c @@ -168,10 +168,10 @@ XMPPRequestVoice(XMPPComponent *jabber, char *from, char *muc) Free(identifier); } bool -XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, char *hash, bool ret) +XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, char *hash, int time, bool ret) { XMLElement *presence, *x, *reply, *history, *photo; - char *from, *id; + char *from, *id, *stime = "3600"; if (!comp || !fr || !muc) { return false; @@ -186,7 +186,17 @@ XMPPJoinMUC(XMPPComponent *comp, char *fr, char *muc, char *hash, bool ret) XMLAddAttr(presence, "id", (id = StrRandom(8))); XMLAddAttr(x, "xmlns", "http://jabber.org/protocol/muc"); history = XMLCreateTag("history"); - XMLAddAttr(history, "seconds", "3600"); /* TODO: Custom timeout */ + + if (time > 0) + { + stime = StrInt(time); + } + XMLAddAttr(history, "seconds", stime); + if (time > 0) + { + Free(stime); + stime = NULL; + } XMLAddChild(x, history); XMLAddChild(presence, x);