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
8/7/2013 5:36 AM
 

Hi again ! 

Thank you very much now I theoretically understand how it works but still cant get it to work! I just want to see all incommoding messages a user have it tried like 

var messageBoxView = DotNetNuke.Services.Social.Messaging.Internal.InternalMessagingController.Instance.GetInbox(2, 1, 10, "LastModifiedOnDate", false);

but I get 0 conversations there 

I also tried to directly run stored procedure CoreMessaging_GetMessageConversations with the same input data I got empty results! but I can see messages in the table CoreMessaging_Messages and in the portal ! 

can you just tell me how to get the list of messages in the inbox of a user and then I guess it is rolling ! 

Thank you very much 

 
New Post
8/7/2013 2:47 PM
 
the API call appears fine i.e. return the first 10 unread email messages for user 2, starting after message 1 and sort by LastModifiedOnDate. Make sure that you're using the right user and have unread messages (or change the final parameter to True to return previously read messages as well)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/20/2013 1:07 PM
 

It took me a while before I understand that user should be actually logged in to get his/her inbox ! So I don't know why actually api asks for user Id at all ?! 

Anyway, now eventually  I can get a list of conversations user has using GetInbox. 

Now I cant figure out these :

1 How to actually create a conversation between 2 users and send the first message ?

2 How to know if a conversation has a new message that user has not seen yet?

 

 Thanks 

 
New Post
8/20/2013 2:52 PM
 

for functions that are intended to be only ran by the currently active user we do not expose the userid typically i.e. we automatically add it via UserController.GetCurrentUserInfo().UserID -however these are normally just for audit columns (i.e. createdbyuserid, updatedbyuserid) though in the case of retrieving an inbox its assumed that only the user will read their inbox (i.e. that admin/host accounts should not be able to use the messaging centre to read users inboxes)

In general if you want to see how things work, you can examine the requests occurring when you do something via a http proxy such as fiddler (or the f12 tools in most browsers). Messaging was designed as a single-page-application with a service framework layer and that's the intended and recommended way to work with it.

You can of course take a look within the code and extract the relevant pieces but it's important to note that there are 2 locations to view the source:

Modules\CoreMessaging\Services\MessagingServiceController.cs

DotNetNuke.Web\InternalServices\MessagingServiceController.cs

As you can see the 2nd class is in an "internal" space i.e. we don't intend for users to use the methods in it directly (i.e. we do not regard it as part of the public API unlike the first class). That said I don't know why this was done for these methods, they seem link they should be public to me (I will look into it)

I would personally recommend you use the service framework calls e.g. http://cathaldnn.com/DesktopModules/I...
but if you cant for some reason then the relevant code is in the Create method of the 2nd class (as you can see by the url above) - you'll be looking to use something such as MessagingController.Instance.SendMessage(message, roles, users, fileIdsList) (note: there is no sender userid as we assume that the person using compose message is the sender - in the same way you do not have to specify a "from" address when writing an email)


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
11/5/2013 10:43 AM
 
Good afternoon

sorry for bumping this thread, but I can't make it work. I want to retrieve all the messages (read and unread) for a user. I have the lines below in my code:

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 first one works correctly and returns the number of conversations. However, the 2nd line doesn't return anything - it says there are 0 conversations. I know there are more than 0.

Any ideas on how to do this? I would be happy to use the Message center from dnn, but we don't want to allow Registered users to send messages, we only want them to read them.

If you can think of a way to achieve this without me developing a module it'd be great!!

Thanks a lot
Carlos
 
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