mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 10:45:11 +00:00
I honestly don't know what to call it.
It's not a 0.2 release, btw.
This commit is contained in:
parent
e7ba1fa48d
commit
3ceae7b053
13 changed files with 179 additions and 85 deletions
|
|
@ -23,12 +23,14 @@ of Parsee. May occasionally deadlock.
|
||||||
#### Deprecated features
|
#### Deprecated features
|
||||||
*NONE*
|
*NONE*
|
||||||
|
|
||||||
### v0.1.1[star-of-hope] <X/X/XXXX>
|
### v0.2.0[star-of-hope] <X/X/XXXX>
|
||||||
Fixes some media metadata things, replaces the build system,
|
Fixes some media metadata things, replaces the build system,
|
||||||
and speeds up Parsee a tad bit.
|
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.
|
||||||
- Allows MbedTLS through a specific Cytoplasm patch.
|
- Allows MbedTLS through a specific Cytoplasm patch.
|
||||||
|
- Kicking/Banning Parsee from XMPP effectively unlinks it.
|
||||||
|
- Start adding documentation to Parsee;
|
||||||
#### Bugfixes
|
#### Bugfixes
|
||||||
- Adds more information to media events so that clients can
|
- Adds more information to media events so that clients can
|
||||||
behave.
|
behave.
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,7 @@ Currently, the main sources of documentation are the Ayadocs(for headers) and th
|
||||||
(see `etc/man`).
|
(see `etc/man`).
|
||||||
|
|
||||||
## TODOS before 1.0 rolls around
|
## TODOS before 1.0 rolls around
|
||||||
- Make Parsee go *vroooooooooommmmmmm*, by NOT asking the server constantly
|
- Make Parsee actually go *vroooooooooommmmmmm*.
|
||||||
about what is available and what is not, as that is a source of latency, and
|
|
||||||
thus slowdowns.
|
|
||||||
- PROPER FUCKING VCARD AVATARS
|
- PROPER FUCKING VCARD AVATARS
|
||||||
XMPP->Matrix is decent, Matrix->XMPP is effectively a WIP
|
XMPP->Matrix is decent, Matrix->XMPP is effectively a WIP
|
||||||
- Add [libomemo](https://github.com/gkdr/libomemo) or something as an optional dependency.
|
- Add [libomemo](https://github.com/gkdr/libomemo) or something as an optional dependency.
|
||||||
|
|
@ -93,6 +91,8 @@ restricted to Parsee admins, with permission from MUC owners, too
|
||||||
- Limiting to admins may be a way to "control" consent for both, but this is
|
- Limiting to admins may be a way to "control" consent for both, but this is
|
||||||
only if Parsee admins are good-willed, which we must assume such statment to
|
only if Parsee admins are good-willed, which we must assume such statment to
|
||||||
be false by default.
|
be false by default.
|
||||||
|
- Currently, MUC owners may kick Parsee out, with the effect of unlinking the
|
||||||
|
MUC.
|
||||||
- Look at XEPS-TBD.TXT for XEPs to be done
|
- Look at XEPS-TBD.TXT for XEPs to be done
|
||||||
- Add a MUC server to Parsee, such that it may be able to hook onto it and therefore
|
- Add a MUC server to Parsee, such that it may be able to hook onto it and therefore
|
||||||
support XMPP->Matrix bridging.
|
support XMPP->Matrix bridging.
|
||||||
|
|
|
||||||
15
XEPS-TBD.TXT
15
XEPS-TBD.TXT
|
|
@ -21,10 +21,14 @@ Somewhat implemented XEPs:
|
||||||
This allows reactions, which Matrix also has support to. The two
|
This allows reactions, which Matrix also has support to. The two
|
||||||
systems don't seem *too* restrictive on one-another (unlike some
|
systems don't seem *too* restrictive on one-another (unlike some
|
||||||
IM platforms I won't mention), so this doesn't sound too bad to do
|
IM platforms I won't mention), so this doesn't sound too bad to do
|
||||||
HALF-IMPLEMENTED: Removing reacts won't work.
|
TODO: Add support from Matrix.
|
||||||
~ https://xmpp.org/extensions/xep-0184.html
|
~ https://xmpp.org/extensions/xep-0184.html
|
||||||
Only Matrix->XMPP as of now. Requesting data from Matrix ASes without
|
Only Matrix->XMPP as of now. Requesting data from Matrix ASes without
|
||||||
/sync seems like a non-option as of now, which _sucks_.
|
/sync seems like a non-option as of now, which _sucks_.
|
||||||
|
~ https://xmpp.org/extensions/xep-0084.html
|
||||||
|
Avatar support would be extremely useful, if just a QoL improvment.
|
||||||
|
Matrix and XMPP both have support for these.
|
||||||
|
XEP-0084 is a pain in the ass to implement and seems generally just
|
||||||
|
|
||||||
For future XEPs:
|
For future XEPs:
|
||||||
- https://xmpp.org/extensions/xep-0449.html
|
- https://xmpp.org/extensions/xep-0449.html
|
||||||
|
|
@ -34,12 +38,7 @@ For future XEPs:
|
||||||
which is used along PEP, it seems, and meanwhile Matrix has ''support''
|
which is used along PEP, it seems, and meanwhile Matrix has ''support''
|
||||||
for packs too, tracking them is between "annoyance" and "yeah, no.".
|
for packs too, tracking them is between "annoyance" and "yeah, no.".
|
||||||
|
|
||||||
ON STANDBY BECAUSE THESE HAVE BEEN TERRIBLE TO DEAL WITH AND WHO KEEPS WRITING
|
On Standby:
|
||||||
THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
|
|
||||||
x https://xmpp.org/extensions/xep-0084.html
|
|
||||||
Avatar support would be extremely useful, if just a QoL improvment.
|
|
||||||
Matrix and XMPP both have support for these.
|
|
||||||
XEP-0084 is a pain in the ass to implement and seems generally just
|
|
||||||
unreliable, however.
|
unreliable, however.
|
||||||
x https://xmpp.org/extensions/xep-0080.html
|
x https://xmpp.org/extensions/xep-0080.html
|
||||||
Can't think of a good analogy to these...
|
Can't think of a good analogy to these...
|
||||||
|
|
@ -48,7 +47,7 @@ THESE I WANT TO SEND THEM A NICE, BRIGHT GIFT:
|
||||||
Not XEPs, but ideas that _needs_ to be added:
|
Not XEPs, but ideas that _needs_ to be added:
|
||||||
~ "GIVE THE PUPPETS APPROPRIATE PLS/ROLES" - Hydro/t4d
|
~ "GIVE THE PUPPETS APPROPRIATE PLS/ROLES" - Hydro/t4d
|
||||||
Happens on Matrix. I'll need to handle that on XMPP as well.
|
Happens on Matrix. I'll need to handle that on XMPP as well.
|
||||||
- Standalone/Static Parsee, ideally as small as it can be(if not as APE).
|
~ Standalone/Static Parsee, ideally as small as it can be(if not as APE).
|
||||||
- Kappa-like extension system(maybe bridging more than just Matrix-XMPP.)
|
- Kappa-like extension system(maybe bridging more than just Matrix-XMPP.)
|
||||||
- https://www.youtube.com/watch?v=InL414iDZmY
|
- https://www.youtube.com/watch?v=InL414iDZmY
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,4 @@ INCLUDES=src/include
|
||||||
OBJECT=build
|
OBJECT=build
|
||||||
CC=cc
|
CC=cc
|
||||||
CFLAGS=-O3
|
CFLAGS=-O3
|
||||||
|
PREFIX=/usr
|
||||||
|
|
|
||||||
50
etc/man/man7/parsee-cmd-syntax.7
Normal file
50
etc/man/man7/parsee-cmd-syntax.7
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
." The last field is the codename, by the way.
|
||||||
|
." ALL MANPAGES FOR PARSEE ARE UNDER PUBLIC DOMAIN
|
||||||
|
.TH parsee-cmd-syntax 7 "Parsee Utility" "star-of-hope"
|
||||||
|
|
||||||
|
.SH NAME
|
||||||
|
parsee-cmd-syntax - Basic syntax information with Parsee Matrix commands
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
Parsee uses a specific syntax for commands, which is generally different
|
||||||
|
from regular bots, but closer to
|
||||||
|
.B dd(1) 's
|
||||||
|
syntax.
|
||||||
|
.PP
|
||||||
|
A command is formatted as so.
|
||||||
|
.sp
|
||||||
|
.if n \{\
|
||||||
|
.RS 4
|
||||||
|
.\}
|
||||||
|
.nf
|
||||||
|
.B ![NAME] arg1=val1 arg2='val2' arg3="val\(rs\(dq3"
|
||||||
|
.fi
|
||||||
|
.if n \{\
|
||||||
|
.RE
|
||||||
|
.\}
|
||||||
|
.sp
|
||||||
|
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.B arg1=val1
|
||||||
|
syntax is to be used for simple values, with values containing no spaces.
|
||||||
|
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.B NAME
|
||||||
|
attribute defines the command to be called, and the
|
||||||
|
.B arg1='val1' ,
|
||||||
|
and
|
||||||
|
.B arg2="val2"
|
||||||
|
syntax is to be used for simple values, with values containing spaces. If
|
||||||
|
the value needs to contain quotes, they may be escaped with
|
||||||
|
.B \(rs'
|
||||||
|
and
|
||||||
|
.B \(rs"
|
||||||
|
respectively.
|
||||||
|
|
||||||
|
.SH LICENSE
|
||||||
|
This document is under public domain, or CC0 if not allowed by local law.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
.B parsee(1)
|
||||||
|
|
@ -25,7 +25,7 @@ CommandParse(char *cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
end_data = strchr(cmd, ' ');
|
end_data = strchr(cmd, ' ');
|
||||||
if (!end_data)
|
if (!end_data || (cmd > end_data))
|
||||||
{
|
{
|
||||||
ret = Malloc(sizeof(*ret));
|
ret = Malloc(sizeof(*ret));
|
||||||
ret->command = StrDuplicate(cmd);
|
ret->command = StrDuplicate(cmd);
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,9 @@ CommandHead(CmdBanUser, cmd, argp)
|
||||||
BotDestroy();
|
BotDestroy();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ASBan(data->config, room, user);
|
|
||||||
|
|
||||||
ReplySprintf("Banning %s from '%s'...",
|
ASBan(data->config, room, user);
|
||||||
user, room
|
ReplySprintf("Banning %s from '%s'...", user, room);
|
||||||
);
|
|
||||||
|
|
||||||
BotDestroy();
|
BotDestroy();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,43 +9,60 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
static bool
|
||||||
|
Grab(ParseeData *data, Command *cmd, char **muc, char **chat_id, char **room)
|
||||||
|
{
|
||||||
|
if (HashMapGet(cmd->arguments, "muc"))
|
||||||
|
{
|
||||||
|
*muc = HashMapGet(cmd->arguments, "muc");
|
||||||
|
|
||||||
|
*chat_id = ParseeGetFromMUCID(data, *muc);
|
||||||
|
*room = ParseeGetRoomID(data, *chat_id);
|
||||||
|
if (!chat_id || !room)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (HashMapGet(cmd->arguments, "room"))
|
||||||
|
{
|
||||||
|
*room = HashMapGet(cmd->arguments, "room");
|
||||||
|
|
||||||
|
*chat_id = ParseeGetFromRoomID(data, *room);
|
||||||
|
*muc = ParseeGetMUCID(data, *chat_id);
|
||||||
|
if (!chat_id || !muc)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
CommandHead(CmdUnlinkMUC, cmd, argp)
|
CommandHead(CmdUnlinkMUC, cmd, argp)
|
||||||
{
|
{
|
||||||
ParseeCmdArg *args = argp;
|
ParseeCmdArg *args = argp;
|
||||||
ParseeData *data = args->data;
|
ParseeData *data = args->data;
|
||||||
HashMap *json, *event = args->event, *mucs;
|
HashMap *json, *event = args->event, *mucs;
|
||||||
DbRef *ref;
|
|
||||||
char *muc = NULL, *chat_id = NULL, *room = NULL;
|
char *muc = NULL, *chat_id = NULL, *room = NULL;
|
||||||
|
|
||||||
BotInitialise();
|
BotInitialise();
|
||||||
|
|
||||||
muc = HashMapGet(cmd->arguments, "muc");
|
if (!Grab(data, cmd, &muc, &chat_id, &room))
|
||||||
if (!muc)
|
|
||||||
{
|
{
|
||||||
ReplyBasic("`muc` field REQUIRED.");
|
ReplyBasic("`muc`|`room` REQUIRED");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref = DbLock(data->db, 1, "chats");
|
chat_id = ParseeGetFromMUCID(data, muc);
|
||||||
json = DbJson(ref);
|
room = ParseeGetRoomID(data, chat_id);
|
||||||
chat_id = StrDuplicate(GrabString(json, 2, "mucs", muc));
|
|
||||||
if (!chat_id)
|
if (!chat_id)
|
||||||
{
|
{
|
||||||
ReplySprintf("No internal mapping to '%s'.", muc);
|
ReplySprintf("No internal mapping to '%s'.", muc);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
mucs = GrabObject(json, 1, "mucs");
|
|
||||||
JsonValueFree(HashMapDelete(mucs, muc));
|
|
||||||
DbUnlock(data->db, ref);
|
|
||||||
|
|
||||||
room = ParseeGetRoomID(data, chat_id);
|
ParseeUnlinkRoom(data, chat_id);
|
||||||
ref = DbLock(data->db, 1, "chats");
|
|
||||||
json = DbJson(ref);
|
|
||||||
mucs = GrabObject(json, 1, "rooms");
|
|
||||||
JsonValueFree(HashMapDelete(mucs, room));
|
|
||||||
DbUnlock(data->db, ref);
|
|
||||||
|
|
||||||
DbDelete(data->db, 2, "chats", chat_id);
|
|
||||||
|
|
||||||
/* TODO: Do it automatically, if *not plumbed* */
|
/* TODO: Do it automatically, if *not plumbed* */
|
||||||
ReplySprintf("The MUC %s is now *unlinked*.", muc);
|
ReplySprintf("The MUC %s is now *unlinked*.", muc);
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ static const Argument arguments[] =
|
||||||
"Generates a parsee.yaml AS file before exiting")
|
"Generates a parsee.yaml AS file before exiting")
|
||||||
Arg('v', false, NULL,
|
Arg('v', false, NULL,
|
||||||
"Forces Parsee to print in a more verbose fashion "
|
"Forces Parsee to print in a more verbose fashion "
|
||||||
"(-vv prints stanzas to stderr)")
|
"(-vvv prints stanzas to stderr)")
|
||||||
Arg('h', false, NULL,
|
Arg('h', false, NULL,
|
||||||
"Generates an help screen(this one!)")
|
"Generates an help screen(this one!)")
|
||||||
|
|
||||||
|
|
@ -116,6 +116,9 @@ Main(Array *args, HashMap *env)
|
||||||
case PARSEE_VERBOSE_LOG:
|
case PARSEE_VERBOSE_LOG:
|
||||||
LogConfigLevelSet(LogConfigGlobal(), LOG_DEBUG);
|
LogConfigLevelSet(LogConfigGlobal(), LOG_DEBUG);
|
||||||
break;
|
break;
|
||||||
|
case PARSEE_VERBOSE_TIMINGS:
|
||||||
|
Log(LOG_DEBUG, "Logging bench information.");
|
||||||
|
break;
|
||||||
case PARSEE_VERBOSE_STANZA:
|
case PARSEE_VERBOSE_STANZA:
|
||||||
Log(LOG_DEBUG, "Enabling stanza printing.");
|
Log(LOG_DEBUG, "Enabling stanza printing.");
|
||||||
break;
|
break;
|
||||||
|
|
@ -226,6 +229,8 @@ Main(Array *args, HashMap *env)
|
||||||
if (ASRegisterUser(parsee_conf, parsee_conf->sender_localpart))
|
if (ASRegisterUser(parsee_conf, parsee_conf->sender_localpart))
|
||||||
{
|
{
|
||||||
char *parsee = ParseeMXID(conf.handlerArgs);
|
char *parsee = ParseeMXID(conf.handlerArgs);
|
||||||
|
|
||||||
|
/* TODO: An hardcoded avatar like this sucks. */
|
||||||
ASSetAvatar(parsee_conf,
|
ASSetAvatar(parsee_conf,
|
||||||
parsee,
|
parsee,
|
||||||
"mxc://tedomum.net/"
|
"mxc://tedomum.net/"
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
#include <Parsee.h>
|
|
||||||
|
|
||||||
#include <Cytoplasm/Memory.h>
|
|
||||||
#include <Cytoplasm/Json.h>
|
|
||||||
|
|
||||||
void
|
|
||||||
ParseeUnlinkRoom(ParseeData *data, char *chat_id)
|
|
||||||
{
|
|
||||||
char *muc, *room;
|
|
||||||
DbRef *ref;
|
|
||||||
if (!data || !chat_id)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
muc = ParseeGetMUCID(data, chat_id);
|
|
||||||
room = ParseeGetRoomID(data, chat_id);
|
|
||||||
if (!muc || !room)
|
|
||||||
{
|
|
||||||
Free(muc);
|
|
||||||
Free(room);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ref = DbLock(data->db, 1, "chats");
|
|
||||||
JsonValueFree(HashMapDelete(
|
|
||||||
GrabObject(DbJson(ref), 1, "rooms"),
|
|
||||||
room
|
|
||||||
));
|
|
||||||
JsonValueFree(HashMapDelete(
|
|
||||||
GrabObject(DbJson(ref), 1, "mucs"),
|
|
||||||
muc
|
|
||||||
));
|
|
||||||
DbUnlock(data->db, ref);
|
|
||||||
DbDelete(data->db, 2, "chats", chat_id);
|
|
||||||
|
|
||||||
Free(muc);
|
|
||||||
Free(room);
|
|
||||||
}
|
|
||||||
|
|
@ -538,3 +538,38 @@ end:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ParseeUnlinkRoom(ParseeData *data, char *chat_id)
|
||||||
|
{
|
||||||
|
char *muc, *room;
|
||||||
|
DbRef *ref;
|
||||||
|
if (!data || !chat_id)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
muc = ParseeGetMUCID(data, chat_id);
|
||||||
|
room = ParseeGetRoomID(data, chat_id);
|
||||||
|
if (!muc || !room)
|
||||||
|
{
|
||||||
|
Free(muc);
|
||||||
|
Free(room);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref = DbLock(data->db, 1, "chats");
|
||||||
|
JsonValueFree(HashMapDelete(
|
||||||
|
GrabObject(DbJson(ref), 1, "rooms"),
|
||||||
|
room
|
||||||
|
));
|
||||||
|
JsonValueFree(HashMapDelete(
|
||||||
|
GrabObject(DbJson(ref), 1, "mucs"),
|
||||||
|
muc
|
||||||
|
));
|
||||||
|
DbUnlock(data->db, ref);
|
||||||
|
DbDelete(data->db, 2, "chats", chat_id);
|
||||||
|
|
||||||
|
Free(muc);
|
||||||
|
Free(room);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,10 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
|
||||||
ParseePushOIDTable(from, occ_id);
|
ParseePushOIDTable(from, occ_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log(LOG_DEBUG, "XEP-421: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "XEP-421: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
if (StrEquals(type, "error"))
|
if (StrEquals(type, "error"))
|
||||||
{
|
{
|
||||||
|
|
@ -268,7 +271,10 @@ end_error:
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Log(LOG_DEBUG, "Error management: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Error management: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
if (moderated)
|
if (moderated)
|
||||||
{
|
{
|
||||||
|
|
@ -296,19 +302,28 @@ end_error:
|
||||||
body = XMLookForUnique(stanza, "body");
|
body = XMLookForUnique(stanza, "body");
|
||||||
|
|
||||||
PEPManagerHandle(thr->info->pep_manager, stanza);
|
PEPManagerHandle(thr->info->pep_manager, stanza);
|
||||||
Log(LOG_DEBUG, "PEP management: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "PEP management: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
to = ParseeDecodeMXID(HashMapGet(stanza->attrs, "to"));
|
to = ParseeDecodeMXID(HashMapGet(stanza->attrs, "to"));
|
||||||
decode_from = ParseeLookupJID(from);
|
decode_from = ParseeLookupJID(from);
|
||||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||||
room = ParseeFindDMRoom(args, to, from);
|
room = ParseeFindDMRoom(args, to, from);
|
||||||
data = body ? ArrayGet(body->children, 0) : NULL;
|
data = body ? ArrayGet(body->children, 0) : NULL;
|
||||||
Log(LOG_DEBUG, "Fetching user info: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Fetching user info: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: CLEAN THAT UP INTO A CREATEDM FUNCTION */
|
/* TODO: CLEAN THAT UP INTO A CREATEDM FUNCTION */
|
||||||
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
mroom_id = ParseeGetBridgedRoom(args, stanza);
|
||||||
Log(LOG_DEBUG, "Bridging event to '%s'...", mroom_id);
|
Log(LOG_DEBUG, "Bridging event to '%s'...", mroom_id);
|
||||||
Log(LOG_DEBUG, "Fetching bridge: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Fetching bridge: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
if (!mroom_id && !room && !XMPPIsParseeStanza(stanza) &&
|
if (!mroom_id && !room && !XMPPIsParseeStanza(stanza) &&
|
||||||
to && *to == '@')
|
to && *to == '@')
|
||||||
{
|
{
|
||||||
|
|
@ -367,7 +382,10 @@ end_error:
|
||||||
StreamFlush(jabber->stream);
|
StreamFlush(jabber->stream);
|
||||||
pthread_mutex_unlock(&jabber->write_lock);
|
pthread_mutex_unlock(&jabber->write_lock);
|
||||||
XMLFreeElement(ps);
|
XMLFreeElement(ps);
|
||||||
Log(LOG_DEBUG, "Subscription to XEP-0084: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Subscription to XEP-0084: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
Free(parsee);
|
Free(parsee);
|
||||||
Free(trim);
|
Free(trim);
|
||||||
|
|
@ -380,7 +398,10 @@ end_error:
|
||||||
pthread_mutex_unlock(&thr->info->chk_lock);
|
pthread_mutex_unlock(&thr->info->chk_lock);
|
||||||
|
|
||||||
LazyRegister(args, encoded, !chat ? res : NULL);
|
LazyRegister(args, encoded, !chat ? res : NULL);
|
||||||
Log(LOG_DEBUG, "Matrix registration: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Matrix registration: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
reactions = XMLookForTKV(stanza,
|
reactions = XMLookForTKV(stanza,
|
||||||
"reactions", "xmlns", "urn:xmpp:reactions:0"
|
"reactions", "xmlns", "urn:xmpp:reactions:0"
|
||||||
|
|
@ -539,7 +560,10 @@ end_error:
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessChatstates(args, stanza);
|
ProcessChatstates(args, stanza);
|
||||||
Log(LOG_DEBUG, "Chatstate management: %fs", Elapsed(rectime));
|
if (args->verbosity >= PARSEE_VERBOSE_TIMINGS)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG, "Chatstate management: %fs", Elapsed(rectime));
|
||||||
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
Free(mroom_id);
|
Free(mroom_id);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ typedef struct ParseeData ParseeData;
|
||||||
|
|
||||||
#define PARSEE_VERBOSE_NONE 0
|
#define PARSEE_VERBOSE_NONE 0
|
||||||
#define PARSEE_VERBOSE_LOG 1
|
#define PARSEE_VERBOSE_LOG 1
|
||||||
#define PARSEE_VERBOSE_STANZA 2
|
#define PARSEE_VERBOSE_TIMINGS 2
|
||||||
|
#define PARSEE_VERBOSE_STANZA 3
|
||||||
#define PARSEE_VERBOSE_COMICAL 53 /* MINUTES */
|
#define PARSEE_VERBOSE_COMICAL 53 /* MINUTES */
|
||||||
|
|
||||||
typedef struct ParseeConfig {
|
typedef struct ParseeConfig {
|
||||||
|
|
@ -100,7 +101,8 @@ typedef struct Argument {
|
||||||
/* A base64-encoded Parsee logo */
|
/* A base64-encoded Parsee logo */
|
||||||
extern const char media_parsee_logo[];
|
extern const char media_parsee_logo[];
|
||||||
|
|
||||||
/* An ASCII-art rendition of "小橋" */
|
/* An ASCII-art rendition of "小橋".
|
||||||
|
* I'm sorry for its quality. If anyone wants to redraw it, feel free. */
|
||||||
#define PARSEE_ASCII_LINES 8
|
#define PARSEE_ASCII_LINES 8
|
||||||
extern const char *parsee_ascii[PARSEE_ASCII_LINES];
|
extern const char *parsee_ascii[PARSEE_ASCII_LINES];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue