Subject: Not able to create new room using Matrix
Hi Alex,
I was trying to create persistent room using the Matrix sdk but to no vail.
I am getting "operation time out" error, looks like not able to enter room.
Below is the code snippet can you please look in to this and help me with the error/problem.
Appreciate any help.
I was trying to create persistent room using the Matrix sdk but to no vail.
I am getting "operation time out" error, looks like not able to enter room.
Below is the code snippet can you please look in to this and help me with the error/problem.
- void xmpp_OnLogin(object sender, Matrix.EventArgs ex)
- {
- MakeRoomPersistent(room);
- //mucManager.EnterRoomAsync(room, "chatadmin");
- //mucManager.RequestRoomConfigurationAsync(room);
- }
- private async void MakeRoomPersistent(Jid room)
- {
- try
- {
- var retiq = await mm.EnterRoomAsync(room, "chatadmin", 30);
- var iq = await mm.RequestRoomConfigurationAsync(room, 30);
- if (iq.Type == Matrix.Xmpp.IqType.result) // only proceed on result
- {
- // Step 2 and 3, parsing the current config and
- // creating the result is done in the same loop here.
- var xdata = iq.Query.Element<Data>();
- {
- Type = FormType.submit
- };
- foreach (var field in xdata.GetFields())
- {
- {
- Type = field.Type, // keep the type
- Var = field.Var // keep the var
- };
- // we are changing the muc#roomconfig_persistentroom only
- // other fields get copied only with the existing values
- if (field.Var == "muc#roomconfig_persistentroom")
- retField.AddValue(true);
- else
- retField.AddValues(field.GetValues().ToArray());
- xDataResult.AddField(retField);
- }
- // Step 4, submit the changed configuration back to the server (room)
- var submitIq = await mm.SubmitRoomConfigurationAsync(room, xDataResult);
- if (submitIq.Type == Matrix.Xmpp.IqType.result)
- output = "success";
- else
- output = "Error";
- }
- }
- catch (TimeoutException te)
- {
- output = te.Message;
- }
- catch (Exception ex)
- {
- output = ex.Message;
- }
- finally
- {
- xmpp.Close();
- }
- output = "nothing happened";
- }
Appreciate any help.
This post was edited 3 times, last on 2015-08-19, 23:42 by Alex.
Edit reason: added code formatting
Edit reason: added code formatting