Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Messaging source codeMessaging source code
Previous
 
Next
New Post
11/5/2013 10:48 AM
 

Good afternoon, 

I may have already posted this, but the site is being a bit funny...

Firstly, apologies for bumping this old thread, but I can't make it work. 

I have the lines below in the module I'm developing:

                    lblMessages.Text = InternalMessagingController.Instance.CountConversations(UserInfo.UserID, PortalId).ToString("");
                    var messageBoxView = InternalMessagingController.Instance.GetInbox(UserInfo.UserID, 1,
                                                                                                  10000,
                                                                                                  "LastModifiedOnDate",
                                                                                                  true,MessageReadStatus.Any, MessageArchivedStatus.Any);


The 1st line works correctly and returns the number of conversations. However, the 2nd line doesn't return anything, it says there are 0 conversations, which I know it's incorrect. Any ideas on what I';m doing wrong? I'm using dnn 7. 

I could be very happy to use the message center module, but we don't want to allow users to send messages, only receive them (only admins can send messages). If you could tell me how to achieve this without developing a module I'd really appreciate it!

Thanks a lot

Carlos

 
New Post
11/5/2013 6:00 PM
 
It should work, though perhaps you're seeing a timeout - try executing the CoreMessaging_GetSentBox in sql server to see if that's the case (i.e. it takes more than 60 seconds) - this function was intended for small numbers of messages i.e. a page of data, not for 10000

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
11/5/2013 6:11 PM
 
If I remember correctly, one problem can be the case that in "internalMessagingController.Instance.GetInbox" the argument of UserInfo.UserID is not really being used, on the other words UserID is being set within the method. I was teased by this before before. try to log in and use the method in a Usercontrol that properly set for dotnetnuke development (something like Christoc's DotNetNuke Module Development Template) cross your fingers and you might get to to work !

This internalMessagingController is really a crazy one :) you need some patients with it ! LOL __doPostBack('dnn$ctr1565$Forum_Container$DNNForum$cmdSubmit','')
 
New Post
11/5/2013 6:50 PM
 

I would suggest updating to the latest version of dnn - in 7.1.2 the messaging system was pretty much totally overhauled.  GetInBox has been depricated completely and now reverts to a separate data service.

Have a look at something like:

 DotNetNuke.Services.Messaging.Data.MessagingDataService md
          = new Services.Messaging.Data.MessagingDataService();

List<DotNetNuke.Services.Messaging.Data.Message> userMessages
          = md.GetUserInbox(PortalId, UserID, 0, 100000);

Westa

 
New Post
11/6/2013 4:37 AM
 

Thanks a lot for the help, I've managed to make it work with the code below. For some reason, changing the afterMessageID to -1 makes a big difference...oh well. Another question - any idea on how to get the status of the messages? If it's read, unread or archived? I can't find that property either on MEssageConversationView or Message...maybe I'll just have to call the GetInbox multiple times with different statuses...

 

var messageBoxView = InternalMessagingController.Instance.GetInbox(UserInfo.UserID, -1,10000,"CreatedOnDate",
                                                                                                  false,MessageReadStatus.Any, MessageArchivedStatus.Any);

                    foreach (MessageConversationView cv in messageBoxView.Conversations)
                    {
                        Message m = InternalMessagingController.Instance.GetMessage(cv.MessageID);
                        lblMessages.Text += "<br>Date: " + m.CreatedOnDate.ToString("dd/MM/yyyy hh:mm") + " From: " + cv.From + " Subject: " + cv.Subject + " Body: " + cv.Body;
                    }

 

 

Thanks a lot!

C

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Messaging source codeMessaging source code


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out