mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:15:11 +00:00
[MOD/META] Clarify LICENSE more, fix chatstates
This commit is contained in:
parent
63285ac24a
commit
2324f9afc0
4 changed files with 48 additions and 16 deletions
|
|
@ -20,14 +20,22 @@ LazyRegister(ParseeData *data, char *mxid, char *name)
|
|||
{
|
||||
ASRegisterUser(data->config, mxid);
|
||||
ref = DbCreate(data->db, 2, "users", hash);
|
||||
HashMapSet(DbJson(ref), "mxid", JsonValueString(mxid));
|
||||
HashMapSet(DbJson(ref), "ts", JsonValueInteger(UtilTsMillis()));
|
||||
if (ref)
|
||||
{
|
||||
HashMapSet(DbJson(ref), "mxid", JsonValueString(mxid));
|
||||
HashMapSet(DbJson(ref),
|
||||
"ts", JsonValueInteger(UtilTsMillis())
|
||||
);
|
||||
}
|
||||
}
|
||||
dbname = GrabString(DbJson(ref), 1, "name");
|
||||
if (name && !StrEquals(dbname, name))
|
||||
{
|
||||
ASSetName(data->config, mxid, name);
|
||||
HashMapSet(DbJson(ref), "name", JsonValueString(name));
|
||||
if (ref)
|
||||
{
|
||||
HashMapSet(DbJson(ref), "name", JsonValueString(name));
|
||||
}
|
||||
}
|
||||
DbUnlock(data->db, ref);
|
||||
Free(hash);
|
||||
|
|
@ -101,8 +109,24 @@ ProcessChatstates(ParseeData *args, XMLElement *stanza)
|
|||
mroom_id = NULL;
|
||||
from_matrix = NULL;
|
||||
}
|
||||
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES) ||
|
||||
XMLookForTKV(stanza, "received", "xmlns", "urn:xmpp:receipts") ||
|
||||
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES))
|
||||
{
|
||||
char *latest = NULL;
|
||||
from_matrix = ParseeGetBridgedUser(args, stanza);
|
||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||
|
||||
latest = ParseeLookupHead(mroom_id);
|
||||
|
||||
ASType(args->config, from_matrix, mroom_id, false);
|
||||
ASPresence(args->config, from_matrix, mroom_id, latest);
|
||||
|
||||
Free(from_matrix);
|
||||
Free(latest);
|
||||
Free(mroom_id);
|
||||
mroom_id = NULL;
|
||||
from_matrix = NULL;
|
||||
}
|
||||
if (XMLookForTKV(stanza, "received", "xmlns", "urn:xmpp:receipts") ||
|
||||
XMLookForTKV(stanza, "displayed", "xmlns", "urn:xmpp:chat-markers:0"))
|
||||
{
|
||||
/* TODO: Use stanza ID if possible */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue