Comments (3)
Should be doable, involves some browser devtools on twitter.com/messages to find out how twitter sends mentions in messages (it's probably a separate field in the send request body) and then parsing the Matrix HTML similar to https://github.com/mautrix/facebook/blob/master/mautrix_facebook/formatter/from_matrix.py to generate that field
Other direction already happens in https://github.com/mautrix/twitter/blob/master/mautrix_twitter/formatter.py
from twitter.
Mostly notes for myself as I debug this, but it appears what happens when a user is mentioned is
-
The "text" key has a value that is the plaintext message, including the raw handle of the user, ie @{USER}.
-
The "entities" object is included in "message" (this also happens for URLs, which are handled correctly), with a "user_mentions" key containing and array of objects with info on the mentioned user. It appears there is already a class, Message Entities, particularly MessageEntityUserMention, that already has the json object that twitter expects is included in the entity.
I'll check out what the formatter is doing to the value of "text" and "user_mentions." Currently it appears the formatter is only sending the full Matrix username in the "text" field, and not including the expected "entities" key.
from twitter.
There's currently no formatter in the Matrix -> Twitter direction, the bridge just sends the plain body.
from twitter.
Related Issues (14)
- login failed:countryCode parameter is missing HOT 1
- Error while polling Twitter: Rate limit exceeded. Will reset in N seconds (endpoint is limited to 450 requests in 15 minutes) The bridge will keep retrying. HOT 1
- Error on initial sync
- Room avatar is not set HOT 1
- Room name containing my own `displayName` HOT 2
- Replace all VARCHAR(255) with TEXT in the database
- Add a config option to filter out low quality messages
- How should I bridge two Twitter accounts? HOT 1
- Add support for new Twitter DM 'replies' HOT 2
- I keep recieving scam message from fake asian women that don't even appear on twitter
- Problem: Missing value for required key entries in InitialStateResponse HOT 1
- Permission errors when issuing a 'sync' HOT 1
- Initialization could not create propper postgres table? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter.