mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[FIX] Ignore unavailable statuses
They aren't that useful, especially in MUCs.
This commit is contained in:
parent
0facbaa5e5
commit
389870c5d3
9 changed files with 108 additions and 9 deletions
|
|
@ -30,13 +30,16 @@ JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name, char
|
|||
|
||||
UnistrFree(uninick);
|
||||
UnistrFree(filtered);
|
||||
UnistrFree(filterASCII);
|
||||
|
||||
/* TODO: vCards! */
|
||||
/* TODO: Make sure that we fall back to plain ASCII if it fails too many
|
||||
* times. */
|
||||
while (!XMPPJoinMUC(data->jabber, jid, rev, hash, -1, true) && nonce < 32)
|
||||
{
|
||||
char *nonce_str = StrInt(nonce);
|
||||
char *input = StrConcat(3, sender, name, nonce_str);
|
||||
char *hex = ParseeHMACS(data->id, input);
|
||||
Unistr *filterASCII = UnistrFilter(uninick, UnistrIsASCII);
|
||||
|
||||
if (strlen(hex) >= 8)
|
||||
{
|
||||
|
|
@ -45,6 +48,7 @@ JoinMUC(ParseeData *data, HashMap *event, char *jid, char *muc, char *name, char
|
|||
|
||||
Free(nick);
|
||||
Free(rev);
|
||||
Free(revscii);
|
||||
|
||||
nick = StrConcat(4, name, "[", hex, "]");
|
||||
rev = StrConcat(3, muc, "/", nick);
|
||||
|
|
@ -364,13 +368,13 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
StanzaBuilder *builder = NULL;
|
||||
DbRef *ref = NULL;
|
||||
HashMap *json = NULL;
|
||||
|
||||
char *unedited_id = MatrixGetEdit(event);
|
||||
|
||||
char *m_sender = GrabString(event, 1, "sender");
|
||||
char *unedited_id = NULL;
|
||||
char *body = GrabString(event, 2, "content", "body");
|
||||
char *id = GrabString(event, 1, "room_id");
|
||||
char *ev_id = GrabString(event, 1, "event_id");
|
||||
char *m_sender = GrabString(event, 1, "sender");
|
||||
char *chat_id, *muc_id;
|
||||
char *chat_id = NULL, *muc_id = NULL;
|
||||
char *reply_id = MatrixGetReply(event);
|
||||
char *xepd = ParseeXMPPify(event);
|
||||
char *type, *user, *xmppified_user = NULL, *to = NULL;
|
||||
|
|
@ -381,6 +385,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
char *encoded_from = NULL;
|
||||
|
||||
bool direct = false;
|
||||
unedited_id = MatrixGetEdit(event);
|
||||
|
||||
if (unedited_id)
|
||||
{
|
||||
|
|
@ -455,6 +460,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
Free(name);
|
||||
Free(avatar);
|
||||
}
|
||||
|
||||
if (reply_id)
|
||||
{
|
||||
/* TODO: Monocles chat DM users HATE this trick!
|
||||
|
|
@ -511,8 +517,8 @@ end:
|
|||
Free(stanza);
|
||||
Free(sender);
|
||||
Free(unauth);
|
||||
Free(unedited_id);
|
||||
Free(encoded_from);
|
||||
Free(unedited_id);
|
||||
|
||||
DbUnlock(data->db, ref);
|
||||
ref = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue