     , (err) ->
         callback err
 
-# Utility function to get the docType linked to an id in the sharing rules
+
+# Utility function to get the docType linked to an id in the sharing rules.
 extractDocType = (rules, id) ->
     docType = (rule.docType for rule in rules when rule.id is id)
     return docType[0]
 
 
-# Utility function to split the concatenated id and shareID
+# Utility function to split the concatenated id and shareID.
 extractIds = (ids) ->
     tokens = ids.split ":"
     return [tokens[0], tokens[1]]
 
 
-# Utility function to determine the undefined article in the notification
+# Utility function to determine the undefined article in the notification.
 articleBeforeDocType = (docType) ->
     l = docType.charAt 0
     # The 'u' has too many exceptions...

    else
        article = "a"

# Retreive all the sharing informations to build a human-readable notification
getSharingInfos = (id, shareID, callback) ->
    path = "request/sharing/byShareID"
    options =

                        docType: docType
                createTemporaryNotif apps[docType], message, callback

    # A shared document has been updated by the sharer.
    else if tokens[2] is "update"
        # The doc id and the shareID are concatenated.
        [id, shareID] = extractIds id

        if id? and shareID?
            getSharingInfos id, shareID, (err, sharing, docType) ->
                if err?
                    log.error err
                # The sharer shouldn't be notified as he created the request.
                else if not sharing.targets? and docType?
                    sharerName = sharing.sharerName
                    article = articleBeforeDocType docType
