[MOD/META] Clarify LICENSE more, fix chatstates

This commit is contained in:
LDA 2024-09-22 18:36:53 +02:00
commit 2324f9afc0
4 changed files with 48 additions and 16 deletions

View file

@ -6,6 +6,12 @@ Dates are to be written as DD/MM/YYYY. Please update the
changelog as you go, no one wants to keep track of every changelog as you go, no one wants to keep track of every
commit done between releases. commit done between releases.
## Release
*There is currently no full releases of Parsee*
## Beta
*There is currently no beta releases of Parsee*
## Alpha ## Alpha
### v0.1.0[tomboyish-bridges-adventure] <9/9/2024> ### v0.1.0[tomboyish-bridges-adventure] <9/9/2024>
Nothing much to say, but this is the first alpha release Nothing much to say, but this is the first alpha release
@ -18,18 +24,19 @@ of Parsee. May occasionally deadlock.
*NONE* *NONE*
### v0.1.1[star-of-hope] <X/X/XXXX> ### v0.1.1[star-of-hope] <X/X/XXXX>
Fixes some media metadata things, and replaces the build Fixes some media metadata things, replaces the build system,
system of Parsee. and speeds up Parsee a tad bit.
#### New things #### New things
- Start dealing with some basic PEP-based avatars. - Start dealing with some basic PEP-based avatars.
#### Bugfixes
- Adds more information to media events so that clients can behave.
- Fixes issues where SIGPIPE can actually just kill Parsee.
- Allows MbedTLS through a specific Cytoplasm patch. - Allows MbedTLS through a specific Cytoplasm patch.
- "Lone" XMPP messages no longer render weirdly on Element Android's #### Bugfixes
weird rendering. - Adds more information to media events so that clients can
- Start fixing bug where Parsee takes several seconds to send a behave.
message coming from XMPP - Fixes issues where SIGPIPE can actually just kill Parsee.
- "Lone" XMPP messages no longer render weirdly on Element
Android's weird rendering.
- Start fixing bug where Parsee takes several seconds to send
a message coming from XMPP
#### Deprecated features #### Deprecated features
- The old `build.c` and `Makefile`s used for building are removed, - The old `build.c` and `Makefile`s used for building are removed,
and replaced by the `configure.c` C file(/script via TCC). and replaced by the `configure.c` C file(/script via TCC).

View file

@ -1,6 +1,6 @@
For the files src/include/Unistring.h, src/Unistr.h rc/Parsee/HMAC.c, src/XML/*, tools/*, src/include/XML.h, etc/*, and Makefile, For the files src/include/Unistring.h, src/Unistr.h rc/Parsee/HMAC.c, src/XML/*, tools/*, src/include/XML.h, etc/*, and Makefile,
see COPYING.CC0. see COPYING.CC0.
For any other file in src/, see COPYING.AGPL as the primary license. For any other file in src/, see COPYING.AGPL as the primary license(AGPL-3.0-or-later)
As Parsee depends on Cytoplasm, its license is left here in COPYING.CYTO As Parsee depends on Cytoplasm, its license is left here in COPYING.CYTO

View file

@ -30,8 +30,9 @@ ASType(const ParseeConfig *c, char *user, char *room, bool status)
json = HashMapCreate(); json = HashMapCreate();
HashMapSet(json, "typing", JsonValueBoolean(status)); HashMapSet(json, "typing", JsonValueBoolean(status));
/* If someone types for 10 minutes straight, they got something weird man. */ /* If someone types for 5 minutes straight, they got something
HashMapSet(json, "timeout", JsonValueBoolean(10 MINUTES)); * weird man. */
HashMapSet(json, "timeout", JsonValueInteger(5 MINUTES));
ctx = ParseeCreateRequest(c, HTTP_PUT, path); ctx = ParseeCreateRequest(c, HTTP_PUT, path);
Free(path); Free(path);
ASAuthenticateRequest(c, ctx); ASAuthenticateRequest(c, ctx);

View file

@ -20,14 +20,22 @@ LazyRegister(ParseeData *data, char *mxid, char *name)
{ {
ASRegisterUser(data->config, mxid); ASRegisterUser(data->config, mxid);
ref = DbCreate(data->db, 2, "users", hash); ref = DbCreate(data->db, 2, "users", hash);
HashMapSet(DbJson(ref), "mxid", JsonValueString(mxid)); if (ref)
HashMapSet(DbJson(ref), "ts", JsonValueInteger(UtilTsMillis())); {
HashMapSet(DbJson(ref), "mxid", JsonValueString(mxid));
HashMapSet(DbJson(ref),
"ts", JsonValueInteger(UtilTsMillis())
);
}
} }
dbname = GrabString(DbJson(ref), 1, "name"); dbname = GrabString(DbJson(ref), 1, "name");
if (name && !StrEquals(dbname, name)) if (name && !StrEquals(dbname, name))
{ {
ASSetName(data->config, mxid, name); ASSetName(data->config, mxid, name);
HashMapSet(DbJson(ref), "name", JsonValueString(name)); if (ref)
{
HashMapSet(DbJson(ref), "name", JsonValueString(name));
}
} }
DbUnlock(data->db, ref); DbUnlock(data->db, ref);
Free(hash); Free(hash);
@ -101,8 +109,24 @@ ProcessChatstates(ParseeData *args, XMLElement *stanza)
mroom_id = NULL; mroom_id = NULL;
from_matrix = NULL; from_matrix = NULL;
} }
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES) || if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES))
XMLookForTKV(stanza, "received", "xmlns", "urn:xmpp:receipts") || {
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")) XMLookForTKV(stanza, "displayed", "xmlns", "urn:xmpp:chat-markers:0"))
{ {
/* TODO: Use stanza ID if possible */ /* TODO: Use stanza ID if possible */