Is there a way to not show invite popups in conversejs when converse is initialized as singleton in embeded mode? - xmpp

I am using conversejs as client for providing a multiuser chat embeded in an html page. User might be added to a lot of groups. When a user is chating in a group and gets invite to join another group a popup is shown to accept the invite, i do not want the user to see that invitation and rather user should stay in the same group that he has opened.
Given bellow is the initialization sample :
converse.initialize({
authentication: 'login',
credentials_url: 'https://myserver.primet.com/chatapi/apiserver/api/chat/autologin/auth?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyJ9.eyJhdWQiOiI2YTE1NzNkMS03ZDZjLTRkZGItYjVlYS1hZGQyZWM1MDkzZjEiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vZmNlNTAxOTUtMjMxNS00N2FmLWE2ODQtZmY5M',
auto_login: 'true',
bosh_service_url: 'https://myserver.primet.com/chatserver/http-bind/',
jid: ‘james#qachatserver.primet.com',
keepalive: true,
trusted: false,
auto_reconnect: true,
muc_nickname_from_jid: true,
auto_join_rooms: ['deal_909090390898989090909#conference.qachatserver.primet.com'],
auto_focus: false,
locked_muc_nickname: true,
show_desktop_notifications: false,
send_chat_state_notifications: false,
blacklisted_plugins: [
'converse-notification'
],
singleton: true,
muc_show_join_leave: false,
visible_toolbar_buttons: {
call: false,
spoiler: false,
emoji: false,
toggle_occupants: true
},
notify_all_room_messages: false,
notification_delay: 3000,
allow_message_corrections: 'false',
view_mode: 'embedded'
}).then(() => { setTimeout(function(){ var toggleButton = document.getElementsByClassName('toggle-occupants fa fa-angle-double-right')[0]; if (toggleButton) { toggleButton.click(); toggleButton.style.display="none"}},500);})

You can set allow_muc_invitations to false.

Related

Flutter - Jitsi Meet I want to add new options or at least modify an option

I'm trying to add new option like invite more people not by link but with a call notification.
anyone solved this issue ?? please help.
you can use feature flages like below
Map<FeatureFlag, Object> featureFlags = {
FeatureFlag.isMeetingNameEnabled: false,
FeatureFlag.isServerUrlChangeEnabled: true,
FeatureFlag.isChatEnabled: false,
FeatureFlag.isAddPeopleEnabled: false,
FeatureFlag.areSecurityOptionsEnabled: false,
FeatureFlag.isCalendarEnabled: false,
FeatureFlag.isCloseCaptionsEnabled: false,
FeatureFlag.isFilmstripEnabled: false,
FeatureFlag.isHelpButtonEnabled: false,
FeatureFlag.isInviteEnabled: false,
FeatureFlag.isLiveStreamingEnabled: false,
FeatureFlag.isLobbyModeEnabled: false,
FeatureFlag.isOverflowMenuEnabled: false,
FeatureFlag.isReactionsEnabled: false,
FeatureFlag.isRaiseHandEnabled: false,
FeatureFlag.isRecordingEnabled: false,
FeatureFlag.isReplaceParticipantEnabled: false,
};
var options = JitsiMeetingOptions(
isVideoMuted: true,
roomNameOrUrl: name,
userDisplayName: prefs.getString('username')!,
serverUrl: 'https://**********',
featureFlags: featureFlags,
);

Postgraphile not exposing non public schema with introspection

When using Postgraphile with express, I can connect to my database, but when running the server via node dist/index.js:
Not working in index.js
const postgraphileOptions: PostGraphileOptions = {
subscriptions: true,
watchPg: true,
dynamicJson: true,
setofFunctionsContainNulls: false,
ignoreRBAC: false,
showErrorStack: 'json',
extendedErrors: ['hint', 'detail', 'errcode'],
appendPlugins: [require('#graphile-contrib/pg-simplify-inflector')],
exportGqlSchemaPath: 'schema.graphql',
graphiql: true,
enhanceGraphiql: true,
allowExplain(_req: any) {
// TODO: customise condition!
return true;
},
enableQueryBatching: true,
legacyRelations: 'omit',
// pgSettings(req: any) {
// /* TODO */
// },
jwtSignOptions: { algorithm: 'RS256' },
jwtPgTypeIdentifier: 'public.jwt_token',
jwtSecret: 'secret',
};
app.use(
postgraphile(
process.env.DATABASE_URL || postgres://postgres:postgres#localhost:5432/my-db,
'private',
{ ...postgraphileOptions }
)
);
The even though I've used comments in the db to hide introspection of some tables in the public schema, these introspections are not hidden.
Nothing in the private schema shows introspection (even when I only specify private in the PostGraphileOptions).
Here's the confusing part. If I run the server using the postgraphile cli, I will see proper introspection and my manually hidden items are not shown.
postgraphile --jwt-token-identifier public.jwt_token --jwt-secret 'secret' -c 'postgres://postgres:postgres#localhost:5432/my-db' -s public,private --watch --enhance-graphiql --dynamic-json
I hope I have provided enough info here. Cheers and thanks in advance!

Push Notifications with RealmDB (MongoDB) and react-native-push-notification

I am using Realm for an already quite elaborate application and I want to finish it by adding push notifications. I have already installed react-native-push-notification and make it works with FCM (Firebase Cloud Messaging).
On the client side, I do receive test notifications from Firebase.
I then configured the push notifications in the Realm console by adding the Sender Id and the API Key.
The problem is that when I send a notification from Realm it ends up in "sent", but absolutely nothing happens, no logs in the Realm console, nothing on the Firebase side and nothing on the client side.
The documentation on push notifications for Realm is really limited and I can't quite figure out what to do. The documentation is mainly directed for IOS and Android.
That's my code in index.js:
import PushNotificationIOS from '#react-native-community/push-notification-ios';
import PushNotification from 'react-native-push-notification';
PushNotification.configure({
onRegister: function (token) {
console.log('TOKEN:', token);
},
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);
},
onRegistrationError: function (err) {
console.error(err.message, err);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
PushNotification.createChannel(
{
channelId: 'fcm_fallback_notification_channel',
channelName: 'FCM CHANNEL',
channelDescription: 'Description test',
},
created => console.log(`CreateChannel returned '${created}'`),
);
PushNotification.localNotification({
channelId: 'fcm_fallback_notification_channel',
vibrate: true,
vibration: 300,
playSound: true,
soundName: 'default',
});
Does anyone know of a tutorial or something that could give me some additional information?
So to make it work, you'll have to add this line in index.js:
PushNotification.subscribeToTopic('topic-id-in-realm-console');
And use the same topic id in Realm console:
It ends up with something like this (index.js):
import PushNotificationIOS from '#react-native-community/push-notification-ios';
import PushNotification from 'react-native-push-notification';
PushNotification.configure({
onRegister: function (token) {
console.log('TOKEN:', token);
},
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);
},
onRegistrationError: function (err) {
console.error(err.message, err);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
PushNotification.subscribeToTopic('topic-id-in-realm-console');// <== HERE
On client:

Cannot read property 'getUniqueId' of undefined

sorry to bother anyone,but i really need help for this,i want to retrieve chat from database(which i already ask this question before),but i try to googling and read all the documentation,and i assumed that i have found the solution,i read the converse.js documentation about developer api,in the Archiving group section,and i got this :
require(['converse'], function (converse) {
converse.plugins.add('myplugin', {
initialize: function () {
this._converse.api.archive.query({'with': 'admin2#localhost'});
}
});
converse.initialize({
jid: 'admin3#localhost',
authentication: 'prebind',
prebind_url: 'bind/bind.php',
allow_logout: false,
debug : true,
whitelisted_plugins: ['converse-inverse','converese-mam','converse-singleton','converse-muc-embedded','myplugin'],
archived_messages_page_size : 20,
message_archiving : "always",
auto_list_rooms: false,
show_chatstate_notifications:true,
message_carbons : true,
sounds_path : "sounds/",
auto_reconnect : true,
use_vcard : true,
auto_subscribe: false,
keepalive : true,
show_send_button:true,
archived_messages_page_size : 20,
bosh_service_url: 'http://localhost:5280/http-bind',
hide_muc_server: false,
play_sounds : true,
show_controlbox_by_default: false,
xhr_user_search: false
});
});
i try it,but i got this error :
Cannot read property 'getUniqueId' of undefined
at Object._converse.queryForArchivedMessages (converse-mam.js:266)
at Object.initialize (dev.html:30)
at PluginSocket.initializePlugin (pluggable.js:196)
at arrayEach (lodash.js:537)
at Object.forEach (lodash.js:9359)
at PluginSocket.initializePlugins (pluggable.js:227)
at Object.initPlugins (converse-core.js:1854)
at Object._converse.initialize (converse-core.js:1875)
at Object.initialize (converse-core.js:2037)
at dev.html:36
i am sorry if this question's kinda simple or stupid,but i really new in using converse.js,and i really like to use and learn more about converse.js in the future because it full features and documentation.
The initialize method of a Converse.js plugin gets called when Converse.js itself gets initialized.
This happens before the user has been logged in (regardless whether that happens automatically or manually).
So you're calling this._converse.api.archive.query({'with': 'admin2#localhost'}); before the user has been logged and an XMPP connection and session has been established.
Instead, you should first listen for the connection event, and then do your query.
converse.plugins.add('myplugin', {
initialize: function () {
var _converse = this._converse;
_converse.on('connected', function () {
_converse.api.archive.query({'with': 'admin2#localhost'});
});
}
});

Decoding the *.gwt.rpc file generated as per GWT's serialization policy

I'm trying to do a bit of background reading on GWT RPC serialization policy and found that GWT whitelists the serializable types in a *.gwt.rpc file post compilation.
The following is an excerpt of one such .gwt.rpc file generated in my application:
com.subex.rocforms.sample.client.gwt.demo.PriorityModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.PriorityModel/3885356691, 3885356691
com.subex.rocforms.sample.client.gwt.demo.TeamModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.TeamModel/3447853257, 3447853257
com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupDateModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupDateModel/2876933254, 2876933254
[Lcom.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupDateModel;, true, true, true, true, [Lcom.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupDateModel;/2086898801, 2086898801
com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupMemberModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupMemberModel/471099479, 471099479
[Lcom.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupMemberModel;, true, true, true, true, [Lcom.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupMemberModel;/2005061951, 2005061951
com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.dayGroup.DayGroupModel/2207687264, 2207687264
com.subex.rocforms.sample.client.gwt.demo.dayGroup.TimeStringModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.dayGroup.TimeStringModel/335976723, 335976723
com.subex.rocforms.sample.client.gwt.demo.scheduleGrid.ComponentModel, true, true, true, true, com.subex.rocforms.sample.client.gwt.demo.scheduleGrid.ComponentModel/2493196280, 2493196280
[Lcom.subex.rocforms.sample.client.gwt.demo.scheduleGrid.ComponentModel;, true, true, true, true, [Lcom.subex.rocforms.sample.client.gwt.demo.scheduleGrid.ComponentModel;/3060182407, 3060182407
Can anybody explain what the four flags quoted after the type in each row indicate?
The best answer to that, other than poking into the code of course, is reading the Brian Slesinsky's reverse engineering notes about the GWT-RPC format. Have a look under the policy file format subsection and you'll find your answer.